Module dc_number_minimal

Module dc_number_minimal 

Source
Expand description

Minimal Document Character (DcChar) numeral encoding and Base64 encapsulation.

Provides the foundational encoding of unsigned 128-bit integers into sequences of short Document Characters (Dcs) using Format 199 and Base64 encapsulation Dcs (short Dcs 127..=190 and 195).

Functionsยง

dc_base64_char_to_digit
Converts a Base64 encapsulation DcChar into its 6-bit numeral value (0..=63) or padding sentinel (64).
dc_base64_char_to_digit_with_resolver
Converts a Base64 encapsulation DcChar into its 6-bit numeral value (0..=63) or padding sentinel (64) using resolver.
dc_base64_digit_to_char
Converts a 6-bit Base64 numeral value (0..=63) or padding sentinel (64) into its corresponding Base64 encapsulation DcChar.
integer_to_dc_number_chars
Encodes an arbitrary-precision malachite::Integer into canonical DcNumber DcChar tokens [Dc 6, <format_dc>, (optional Dc 11), <base64 digits>, Dc 7].
is_dc_base64_encapsulation_char
Returns true if ch is a Base64 encapsulation digit (127..=190) or padding (195).
is_dc_base64_encapsulation_char_with_resolver
Returns true if ch is a Base64 encapsulation digit (127..=190) or padding (195) according to resolver.
read_dc_number_u128
Reads a single unsigned 128-bit integer from a slice of Document Character Global Graph IDs (&[u128]), returning the parsed u128 integer and the number of tokens consumed from the slice.
read_dc_number_u128_with_resolver
Reads a single unsigned 128-bit integer from a slice of Document Character Global Graph IDs (&[u128]) using resolver, returning the parsed u128 integer and the number of tokens consumed from the slice.
read_typed_dc_integer
Convenience wrapper for read_typed_dc_integer_with_resolver using the default dataset syntax resolver.
read_typed_dc_integer_with_resolver
Reads an arbitrary-precision signed integer from a DcNumber token slice ([Dc 6, <format_dc>, (optional sign), <base64 digits>+, Dc 7]).
u128_to_dc_number_chars
Encodes an unsigned 128-bit integer into a sequence of DcChars.
u128_to_dc_number_short
Encodes an unsigned 128-bit integer into a sequence of short Document Character IDs (u32).