def hex
import bend-kit-sigv4@0.11.0.1/sigv4.bend as Sigv4import Base
615# ponytail: no overflow check; a reference past U+10FFFF wraps and decodes to junk rather than failing.
616def hex(s: String, m: Maybe<&2, U32>) -> Maybe<&2, U32>:
617 match s:
618 case SNil{}:
619 m
620 case SCon{Chr{c}, t}:
621 match m:
622 case None{}:
623 None{}
624 case Some{acc}:
625 hex(t, hex.step(hex.digit(c), acc))