def file.block.parts

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:257

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

257# Unpacks both copies before hashing and constructing the block.
258def file.block.parts(
259  headers: Bytes.Bytes & Bytes.Bytes,
260  frames: Bytes.Bytes & Bytes.Bytes,
261  +level: U32,
262  +total: U32,
263  +payload_len: U32
264) -> Result<&1, &1, Error, Bytes.Bytes>:
265  match headers:
266    case (block_output, block_hash):
267      match frames:
268        case (frame_output, frame_hash):
269          file.digest(block_output, frame_output,
270            SHA.sha256_packed_bytes(Bytes.concat([block_hash, frame_hash])),
271            level, total, payload_len)

Uses (10)

Used by (1)