aiken_flat/flat

Constants

decode_bool: fn(ByteArray) -> Bool

Decoder counterpart for encode_bool.

decode_bytes: fn(ByteArray) -> ByteArray

Decoder counterpart for encode_bytes.

decode_integer: fn(ByteArray) -> Int

Decoder counterpart for encode_integer.

decode_u8: fn(ByteArray) -> ByteArray

Decoder counterpart for unsafe_encode_u8.

encode_bool: fn(Bool) -> ByteArray

Encodes a given Bool in Flat (with post-alignment).

encode_bytes: fn(ByteArray) -> ByteArray

Breaks up a given ByteArray into chunks of 255 bytes, prefixes each chunk with its length, and ends the encoding with a #"00".

encode_integer: fn(Int) -> ByteArray

After applying zig-zag to a given Int, encodes it using encoder.word (with post-alignment).

unsafe_encode_u8: fn(ByteArray) -> ByteArray

Encodes a given Byte in Flat (no validations on the input to ensure it’s a single byte).

Functions

make_encoder(en: en.EncoderFn<a>) -> fn(a) -> ByteArray

Encoder Maker

make_decoder(de: de.DecoderFn<a>) -> fn(ByteArray) -> a

Decoder Maker

Search Document