def b64.go
import emerging-ezhttp@0.21.0.0/src/b64.bend as B64import Base
63# octets to Base64, three at a time (RFC 4648 §4)
64def b64.go(bs: List<&2, U32>, phase: Phase) -> String:
65 match bs:
66 case []:
67 b64.end(phase)
68 case h <> t:
69 match phase:
70 case Need3{}:
71 b64.go(t, Need2{h})
72 case Need2{first}:
73 b64.go(t, Need1{first, h})
74 case Need1{first, second}:
75 b64.quad(first, second, h, 0n) ++ b64.go(t, Need3{})