def base64.digit

gralha-bytes@0.1.0.1 · bytes.bend:89

import gralha-bytes@0.1.0.1/bytes.bend as Bytes
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

89def base64.digit(+c: U32) -> U32:
90  U.choose(U32, U32.is_ge(c, 65) && U32.is_le(c, 90), (c - 65 : U32),
91    U.choose(U32, U32.is_ge(c, 97) && U32.is_le(c, 122), (c - 71 : U32),
92      U.choose(U32, U32.is_ge(c, 48) && U32.is_le(c, 57), (c + 4 : U32), U.choose(U32, U32.is_eq(c, 43), 62, U.choose(U32, U32.is_eq(c, 47), 63, 64)))))

Uses (8)

Used by (1)