def framed
import stelliferous@0.0.2.0/tensor_file.bend as TensorFileimport Base
406# Version 1: the header ends in a newline and the data starts at a multiple of 64 bytes.
407def framed(+text: List<&2,U32>,+length: U32) -> List<&2,U32>:
408 +padding = ((64 - (11 + length) % 64) % 64 : U32)
409 +total = (length + padding + 1 : U32)
410 List.append(&2,U32,magic(),1 <> 0 <> (total % 256 : U32) <> (total / 256 : U32) <> List.append(&2,U32,text,spaces(U32.to_nat(padding))))