def b64.put
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
732# A whole group of four chars writes its bytes at o, as many as fit before len.
733def b64.put(full: Bool, a: Array<U32>, +o: U32, +w: U32, +v: U32) -> Array<U32>:
734 match full:
735 case True{}:
736 put.go(U32.to_nat(w), a, (o + w - 1 : U32), False{}, U32.shrn(v, U32.to_nat(((3 - w) * 8 : U32))))
737 case False{}:
738 a