Attach context to the encoder.
The context object can be used to pass some "global" parameters down to custom encoders.
Optionalcontext: unknownEncode a bit vector with known length.
The bits are packed into bytes and just placed as-is in the destination. https://graypaper.fluffylabs.dev/#/579bd12/378000378000
Encode a bit vector with variable length.
A bit-length discriminator (varU32) is placed before the packed bit content. https://graypaper.fluffylabs.dev/#/579bd12/378200378200
Encode a variable-length sequence of bytes.
The data is placed in the destination, but with an
extra length-discriminator (see [u32]) encoded in a compact form.
Encode a single boolean discriminator using variable encoding.
Encode a fixed-length sequence of bytes.
The data is simply copied to the destination without any discriminator (i.e. no length prefix).
Encode a variable-length sequence of bytes given as [BytesBlob].
That's just a convenience wrapper for [blob] function.
Get the encoding context object.
Encode a 16-bit integer.
The encoding will always occupy 2 bytes in little-endian ordering. Negative numbers are represented as a two-complement.
Encode a 24-bit integer.
The encoding will always occupy 3 bytes in little-endian ordering. Negative numbers are represented as a two-complement.
Encode a 32-bit integer.
The encoding will always occupy 4 bytes in little-endian ordering. Negative numbers are represented as a two-complement.
Encode a 64-bit integer.
The encoding will always occupy 8 bytes in little-endian ordering. Negative numbers are represented as a two-complement.
Encode a 8-bit integer.
The encoding will always occupy 1 byte in little-endian ordering. Negative numbers are represented as a two-complement.
Encode a potentially empty value.
A 0 or 1 is placed before the element to indicate it's presence. https://graypaper.fluffylabs.dev/#/579bd12/375f00375f00
Encode a fixed-length sequence of elements of some type.
Encode a variable-length sequence of elements of some type.
A length discriminator is placed before the concatentation of encodings of all the elements.
Encode a 32-bit natural number (compact).
The encoding can take variable amount of bytes depending on the actual value.
Encode a 64-bit natural number (compact).
The encoding can take variable amount of bytes depending on the actual value.
View the current encoding result.
Note that the resulting array here, might be shorter than the
underlying destination.
StaticcreateStaticencode
JAM encoder.