def partial
import bend-collections@1.0.0.0/src/crypto/blake/blake3/blake3.bend as Blake3import Base
95# The block truncated to its first `len` bytes: the word at byte offset pos
96# keeps its low len - pos bytes (all four when at least four remain).
97def partial(w: U32, delta: Nat) -> U32:
98 match delta:
99 case 0n: 0
100 case 1n: U32.and(w,255)
101 case 2n: U32.and(w,65535)
102 case 3n: U32.and(w,16777215)
103 case 4n+q: w