def pack4
import lawful-words@0.1.0.0/defs.bend as Defsimport Base
30# The word whose bytes 0 to 3 are b0 to b3: b0 | b1 << 8 | b2 << 16 | b3 << 24.
31# Meant for bytes below 256: larger values spill into the next byte.
32def pack4(b0: U32, b1: U32, b2: U32, b3: U32) -> U32:
33 U32.or(b0, U32.or(U32.shln(b1, 8n), U32.or(U32.shln(b2, 16n), U32.shln(b3, 24n))))