Field.digits: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend as Field Lines 17-24 of bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend&start_line=17&end_line=24 import Base import bend-collections@1.0.0.0/spec/lib/common.bend as C # a number from its little-endian radix-2^16 digits, each scaled by one: # digits(1, [d0, d1, ...]) = d0 + 2^16 d1 + ... def digits(+one: Nat, ds: List<&2, Nat>) -> Nat: match ds: case Nil{}: 0n case d <> dt: Nat.add(Nat.mul(one, d), C.shift(16n, digits(one, dt))) Uses (5): 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=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/lib/common.bend&name=shift