def pct

emerging-ezhttp@0.21.0.0 · src/pct.bend:26

import emerging-ezhttp@0.21.0.0/src/pct.bend as Pct
import Base

26# bytes as %XX triples, high nibble first, followed by `rest`
27def pct(bytes: List<&2, U32>, rest: String) -> String:
28  match bytes:
29    case []:
30      rest
31    case +byte <> tail:
32      SCon{'%', SCon{hex(U32.shrn(byte, 4n)), SCon{hex(U32.and(byte, 15)),
33        pct(tail, rest)}}}

Uses (7)

Used by (1)