Http.utf8.need: def of gralha-http-core@0.1.0.0 Import: import gralha-http-core@0.1.0.0/http.bend as Http Lines 81-87 of gralha-http-core@0.1.0.0/http.bend: https://jend.leeeet.dev/read.txt?path=gralha-http-core@0.1.0.0/http.bend&start_line=81&end_line=87 import Base # Decoding reads a byte at a time: need is the continuation bytes still # owed and code the bits so far. A byte out of place is U+FFFD. def utf8.need(+b: U32, +need: U32) -> U32: when(U32, U32.is_eq(need, 0), _ => when(U32, U32.is_ge(b, 240), _ => 3, _ => when(U32, U32.is_ge(b, 224), _ => 2, _ => when(U32, U32.is_ge(b, 192), _ => 1, _ => 0))), _ => when(U32, U32.is_eq((b .&. 192 : U32), 128), _ => (need - 1 : U32), _ => 0)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_ge https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=when