SstFile.parse.hash.words.go: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile Lines 896-912 of mylsm-lsm-store@0.6.0.1/src/SstFile.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&start_line=896&end_line=912 import Base import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Read exactly eight words into a digest without consuming a byte after it. def parse.hash.words.go( remaining: Nat, read: HashRead, digest: Bytes.Bytes, +offset: U32 ) -> Bytes.Cursor & Result<&1, &1, Error, Bytes.Bytes>: match remaining read: case 0n HashInput{cursor, _}: (cursor, Done{digest}) case 1n+0n HashInput{cursor, Some{word}}: (cursor, Done{Bytes.set.u32be(digest, offset, word)}) case 1n+1n+rest HashInput{cursor, Some{word}}: parse.hash.words.go(1n+rest, parse.hash.wrap(Bytes.Cursor.u32be(cursor)), Bytes.set.u32be(digest, offset, word), (offset + 4 : U32)) case 1n+_ HashInput{cursor, None{}}: (cursor, Fail{Malformed{}}) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add 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-bytes@0.3.3.0/bytes.bend&name=Cursor https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Cursor.u32be https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=set.u32be https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=HashRead https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=parse.hash.wrap