Bijou64 (Bijou64 v0.1.0)

Copy Markdown View Source

Bijou64 is a purely canonical variable length encoding for u64 integers.

Each integer can only be represented by a single encoded value, which aids security if the data is signed.

See https://www.inkandswitch.com/tangents/bijou64/

Summary

Types

Valid integers are unsigned integers up to 64 bits.

Functions

Decodes valid u64 integers according to the bujou64 format from the start of a binary.

Encodes valid u64 integers according to the bujou64 format.

Types

u64()

@type u64() :: 0..18_446_744_073_709_551_615

Valid integers are unsigned integers up to 64 bits.

Functions

decode(arg)

@spec decode(binary()) :: {u64(), binary()}

Decodes valid u64 integers according to the bujou64 format from the start of a binary.

encode(int)

@spec encode(u64()) :: binary()

Encodes valid u64 integers according to the bujou64 format.