Bytes
let concat: (a: bytes, b: bytes) => bytes
Concatenate together two bytes
arguments and return the result.
let concats: (bs: list<bytes>) => bytes
Concatenate together a list of bytes
and return the result.
let sub : (start: nat, length: nat, input: bytes) => bytes
Extract bytes from start
to length
. For example if you gave the
input "ff7a7aff" to the following function:
It would return "7a7a".
let pack : (data: 'a) => bytes
Converts Michelson data structures to a binary format for serialisation.
⚠️
PACK
andUNPACK
are features of Michelson that are intended to be used by people that really know what they're doing. There are several failure cases (such asUNPACK
ing a lambda from an untrusted source), most of which are beyond the scope of this document. Don't use these functions without doing your homework first.
let unpack: (serialized_data: bytes) => option<'a>
Reverses the result of using pack
on data.
As the conversion might fail an option type is returned.
⚠️
PACK
andUNPACK
are features of Michelson that are intended to be used by people that really know what they're doing. There are several failure cases (such asUNPACK
ing a lambda from an untrusted source), most of which are beyond the scope of this document. Don't use these functions without doing your homework first.
let length: (b: bytes) => nat