def digest_bytes

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

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

49# Big-endian octets, represented as U32 values in 0..255.
50def digest_bytes(ws: List<&2, U32>) -> List<&2, U32>:
51  match ws:
52    case Nil{}:
53      Nil{}
54    case +w <> tail:
55      U32.and(U32.shrn(w, 24n), 255) <>
56      U32.and(U32.shrn(w, 16n), 255) <>
57      U32.and(U32.shrn(w, 8n), 255) <>
58      U32.and(w, 255) <> digest_bytes(tail)

Uses (4)

Used by (1)