Sha.fill: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/share/sha.bend as Sha Lines 45-59 of ezx@1.11.0.0/src/share/sha.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/share/sha.bend&start_line=45&end_line=59 import Base # the string packed into the array, four bytes to a word. A short tail packs # zeros in the unused bytes; the byte length says they are padding. The walk # calls itself on the tail, which is the string shrinking. def fill(text: String, +index: U32, arr: Array) -> Array: match text: case SNil{}: arr case SCon{w, SNil{}}: Array.set(U32, arr, index, pack(byte(w), 0, 0, 0)) case SCon{w, SCon{x, SNil{}}}: Array.set(U32, arr, index, pack(byte(w), byte(x), 0, 0)) case SCon{w, SCon{x, SCon{y, SNil{}}}}: Array.set(U32, arr, index, pack(byte(w), byte(x), byte(y), 0)) case SCon{w, SCon{x, SCon{y, SCon{z, t}}}}: fill(t, U32.inc(index), Array.set(U32, arr, index, pack(byte(w), byte(x), byte(y), byte(z)))) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.inc https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/sha.bend&name=byte https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/sha.bend&name=pack