def frame.verify.end

mylsm-lsm-store@0.6.0.1 · src/Wal.bend:410

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

410def frame.verify.end(
411  at_end: Bool,
412  bytes: Bytes.Bytes,
413  claimed: Bytes.Bytes,
414  records: List<&2, Mut>,
415  +end: U32
416) -> Result<&1, &1, Error, Batch>:
417  match at_end:
418    case False{}:
419      Fail{Malformed{}}
420    case True{}:
421      frame.verify.equal(records, Bytes.eq(claimed,
422        SHA.sha256_packed_bytes(frame.digest.prefix(
423          Bytes.slice(bytes, 0, (end - 32 : U32))))))

Uses (14)

Used by (1)