def utf8.len

cswap-bend-cli@0.1.0.0 · b64.bend:44

import cswap-bend-cli@0.1.0.0/b64.bend as B64
import Base

44# Continuation bytes a lead byte announces.
45def utf8.len(+b: U32) -> U32:
46  sel(U32.is_lt(b, 128), 0, sel(U32.is_lt(b, 224), 1, sel(U32.is_lt(b, 240), 2, 3)))

Uses (3)

Used by (3)