Sha.nth: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/sha.bend as Sha Lines 79-88 of bend-collections@1.0.0.0/spec/crypto/sha.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/sha.bend&start_line=79&end_line=88 import Base # In reverse history, index j denotes W[t-1-j]. Only valid indices are # reached for the actual 16-word input blocks; default zero makes nth total. def nth(history: List<&2, U32>, index: Nat) -> U32: match history index: case Nil{} _: 0 case w <> rest 0n: w case w <> rest 1n+p: nth(rest, p) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32