def sha256_packed

mylsm-lsm-store@0.6.0.1 · src/hub_sha/sha256.bend:179

import mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend as Sha256
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Packed

179# SHA-256 directly over packed bytes. Full blocks are read as sixteen u32be
180# words; only the final 0..63 octets use the existing tail padding interface.
181def sha256_packed(bytes: Packed.Bytes) -> List<&2, U32>:
182  match bytes:
183    case Packed.Bytes{+len, buf}:
184      packed.start(len, Packed.Cursor.new(Packed.Bytes{len, buf}))

Uses (5)

Used by (1)