def hex.val.digit

ezx@1.11.0.0 · src/sha/nar.bend:179

import ezx@1.11.0.0/src/sha/nar.bend as Nar
import Base

179def hex.val.digit(is_digit: Bool, +code: U32) -> U32:
180  match is_digit:
181    case True{}:
182      U32.sub(code, 48)
183    case False{}:
184      hex.val.lower(Bool.and(U32.is_ge(code, 97), U32.is_le(code, 102)), code)

Uses (7)

Used by (1)