Eyeon.Binary (eyeon v0.2.0)

Copy Markdown View Source

Shared primitives for Ion binary encoding: VarUInt, VarInt, UInt, Int.

Ion binary uses big-endian byte order. VarUInt/VarInt use 7 bits per byte with the high bit as a stop bit (1 = last byte).

Summary

Functions

encode_int(value)

@spec encode_int(integer()) :: binary()

encode_uint(value)

@spec encode_uint(non_neg_integer()) :: binary()

encode_varint(value)

@spec encode_varint(integer()) :: binary()

encode_varuint(value)

@spec encode_varuint(non_neg_integer()) :: binary()

read_int(data, len)

@spec read_int(binary(), non_neg_integer()) :: {integer(), binary()}

read_uint(data, len)

@spec read_uint(binary(), non_neg_integer()) :: {non_neg_integer(), binary()}

read_varint(arg)

@spec read_varint(nonempty_binary()) :: {integer(), binary()}

read_varuint(data)

@spec read_varuint(nonempty_binary()) :: {non_neg_integer(), binary()}