def word_octets

bend-collections@1.0.0.0 · spec/crypto/sha.bend:182

import bend-collections@1.0.0.0/spec/crypto/sha.bend as Sha
import Base

182# FIPS digest serialization: most significant octet of each word first.
183def word_octets(+w: U32) -> List<&2, U32>:
184  [U32.and(U32.shrn(w, 24n), 255),
185   U32.and(U32.shrn(w, 16n), 255),
186   U32.and(U32.shrn(w, 8n), 255), U32.and(w, 255)]

Uses (4)

Used by (3)