Hash.bytewise: def of bend-kit-hash@0.3.0.2 Import: import bend-kit-hash@0.3.0.2/hash.bend as Hash Lines 128-131 of bend-kit-hash@0.3.0.2/hash.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-hash@0.3.0.2/hash.bend&start_line=128&end_line=131 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # A hash that eats one byte at a time: word takes the four bytes of a word, byte one. def bytewise(~T: Type, ~byte: T -> @+c: U32 -> T, ~word: T -> @+c: U32 -> T, b: Bytes.Bytes, acc: T) -> Bytes.Bytes & T: Bytes.Bytes{+len, buf} = b bytewise.rest(~T, ~byte, len, wfrom(~T, ~word, U32.to_nat((len >> 2n : U32)), buf, 0, acc)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-hash@0.3.0.2/hash.bend&name=bytewise.rest https://jend.leeeet.dev/definition.txt?path=bend-kit-hash@0.3.0.2/hash.bend&name=wfrom