def hex

bend-kit-sigv4@0.11.0.1 · sigv4.bend:615

import bend-kit-sigv4@0.11.0.1/sigv4.bend as Sigv4
import 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))

Uses (6)

Used by (1)