def decode.checksum.prefix

mylsm-lsm-store@0.6.0.1 · src/ByteWal.bend:880

import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal
import Base
import mylsm-lsm-store@0.6.0.1/src/Wal.bend as Wal
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

880# Parses the retained digest after hashing its exact frame prefix.
881def decode.checksum.prefix(
882  pair: Bytes.Bytes & Bytes.Bytes,
883  batch: Batch,
884  digest_offset: U32
885) -> Result<&1, &1, Wal.Error, Batch>:
886  match pair:
887    case (frame, prefix):
888      decode.checksum.claimed(bytes.slice(frame, digest_offset, 32), batch,
889        SHA.sha256_packed_bytes(prefix))

Uses (10)

Used by (1)