Bytes
function concat : bytes -> bytes -> bytes
Concatenate together two bytes
arguments and return the result.
Note that
bytes_concat
is deprecated.
function sub : nat -> nat -> bytes -> bytes
Extract bytes from start
to length
. For example if you gave the
input "ff7a7aff" to the following function:
Note that
bytes_slice
is deprecated.
It would return "7a7a".
function pack : 'a -> bytes
Converts Michelson data structures to a binary format for serialization.
⚠️
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.
function unpack : 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.
function length : bytes -> nat