def block.checksum.lengths

mylsm-lsm-store@0.6.0.1 · src/transfer/Restore.bend:177

import mylsm-lsm-store@0.6.0.1/src/transfer/Restore.bend as Restore
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

177def block.checksum.lengths(
178  lengths: U32 & U32,
179  copies: Bytes.Bytes & Bytes.Bytes
180) -> Bool:
181  match lengths:
182    case (hash_length, claim_offset):
183      match copies:
184        case (for_hash, for_claim):
185          digest.matches(slice.result(Bytes.slice(for_claim, claim_offset, 32)),
186            slice.result(Bytes.slice(for_hash, 0, hash_length)))

Uses (8)

Used by (1)