ByteBlockReader.block.checksum.valid.copies: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader Lines 139-148 of mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&start_line=139&end_line=148 import Base import mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend as SHA import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes def block.checksum.valid.copies( copies: Bytes.Bytes & Bytes.Bytes, +payload_length: U32 ) -> Bool: match copies: case (for_hash, for_checksum): block.checksum.compare(Bytes.eq( SHA.sha256_packed_bytes(bytes.slice.result(Bytes.slice(for_hash, 0, U32.add(8, payload_length)))), bytes.slice.result(Bytes.slice( for_checksum, U32.add(8, payload_length), 32)))) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair 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=eq https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=slice https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend&name=sha256_packed_bytes https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=block.checksum.compare https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=bytes.slice.result