def fixed_bytes

qasim-bend-kit@0.1.0.2 · libs/AES256GCM.bend:232

import qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend as AES256GCM
import Base

232# Serialize validated fixed-size fields through a fixed-size byte view. This
233# makes the wire length structural even when the constructor certificate is
234# erased from runtime storage.
235def fixed_bytes(n: Nat, bytes: List<&2, U32>) -> List<&2, U32>:
236    match n:
237        case 0n: Nil{}
238        case 1n+p:
239            match bytes:
240                case Nil{}: 0 <> fixed_bytes(p, Nil{})
241                case byte <> tail: byte <> fixed_bytes(p, tail)

Uses (3)

Used by (9)