def octets

bend-collections@1.0.0.0 · src/crypto/aes/gcm.bend:111

import bend-collections@1.0.0.0/src/crypto/aes/gcm.bend as Gcm
import Base

111# [n]_(8*width), most significant byte first.
112def octets(width: Nat, +n: Nat) -> List<&2, U32>:
113  match width:
114    case 0n:
115      Nil{}
116    case 1n+p:
117      List.append(&2, U32, octets(p, Nat.div(n, 256n)), [U32.from_nat(Nat.mod(n, 256n))])

Uses (7)

Used by (1)