def hex
import bend-osdev-bytes@0.1.1.0/bytes.bend as Bytesimport Base
232# two lower-case hex digits per byte
233def hex(xs: List<&2, U32>) -> String:
234 match xs:
235 case Nil{}:
236 SNil{}
237 case Con{h, t}:
238 +b = byte(h)
239 SCon{hex.digit(U32.shrn(b, 4n)), SCon{hex.digit(U32.and(b, 15)), hex(t)}}