def b64.go
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
695# Groups of three bytes, last first; r holds the 24 bits of the group at i.
696def b64.go(n: Nat, r: Array<U32> & U32, +i: U32, acc: String) -> String:
697 match n:
698 case 0n:
699 acc
700 case 1n+p:
701 (a, +v) = r
702 +j = (i - 3 : U32)
703 b64.go(p, uint.go(3n, peek(a, j), j, True{}, 0), j, SCon{b64.at(v, 18n), SCon{b64.at(v, 12n), SCon{b64.at(v, 6n), SCon{b64.at(v, 0n), acc}}}})