Expand description
Document Character (Dc) numeric encoding and base64 encapsulation utilities.
Provides encoding and decoding of numbers in Dc streams using Base64 encapsulation digits (short Dcs 127..=190 and 195).
Standard structure of a Dc number:
- Dc 6 (
Begin number) - Dc for format 199 (Global Graph ID
2228423or short Dc199) - Optional Dc 10 (
Positive) or Dc 11 (Negative) - Absolute value of integer converted to Base64 (using
ctb_formats_math::base) and encoded as Base64 encapsulation Dcs (127..=190) - Dc 7 (
End number)
Structs§
- DcChar
- A single Document Character (Dc) or Unicode codepoint, represented as a 128-bit integer.
Constants§
- DC_
BASE64_ END - Base 64 encapsulation digit 63 (Dc 190).
- DC_
BASE64_ PADDING - Base 64 encapsulation padding character (Dc 195).
- DC_
BASE64_ START - Base 64 encapsulation digit 0 (Dc 127).
- DC_
BEGIN_ NUMBER - Begin a DCE number. (Dc 6).
- DC_
END_ NUMBER - End a DCE number. (Dc 7).
- DC_
INTEGER - DcChar constant for Format
Integer(Short f199, Category: number): Integer number - DC_
NEGATIVE - Negative (syntactical representation — This is not the − character) (Dc 11).
- DC_
POSITIVE - Positive value (syntactical representation — This is not the + character) (Dc 10).
Traits§
Functions§
- base64_
char_ to_ global_ dc - Converts a single standard Base64 character or padding character (
=) into its corresponding Global Graph ID. - base64_
char_ to_ short_ dc - Converts a single standard Base64 character or padding character (
=) into its corresponding short Document Character (Dc) ID (127..=190, 195). - base64_
str_ to_ global_ dcs - Converts a string of standard Base64 characters into Global Graph IDs.
- base64_
str_ to_ short_ dcs - Converts a string of standard Base64 characters and padding into a vector of short Document Characters (127..=190, 195).
- dc_
base64_ char_ to_ digit - Converts a Base64 encapsulation
DcCharinto its 6-bit numeral value (0..=63) or padding sentinel (64). - dc_
base64_ digit_ to_ char - Converts a 6-bit Base64 numeral value (0..=63) or padding sentinel (64) into
its corresponding Base64 encapsulation
DcChar. - global_
dc_ to_ base64_ char - Converts a single Global Graph ID (in the Base64 encapsulation range) into
its corresponding standard Base64 character or padding character (
=). - global_
dcs_ to_ base64_ str - Converts a sequence of Global Graph IDs into a standard Base64 string.
- i128_
to_ dc_ number_ chars - Converts an
i128integer into a sequence ofDcChars. - i128_
to_ dc_ number_ global - Converts an
i128integer into a sequence of Global Graph IDs (DcList). - i128_
to_ dc_ number_ short - Converts an
i128integer into a sequence of short Document Characters (Dcs). - integer_
to_ dc_ number_ chars - Converts an
Integerinto a sequence ofDcChars. - integer_
to_ dc_ number_ global - Converts an
Integerinto a sequence of Global Graph IDs (DcList). - integer_
to_ dc_ number_ short - Converts an
Integerinto a sequence of short Document Characters (Dcs). - is_
dc_ base64_ encapsulation_ char - Returns
trueifchis a Base64 encapsulation digit (127..=190) or padding (195). - natural_
to_ dc_ number_ chars - Converts a
Naturalnumber (with an optional negative sign flag) into a sequence ofDcChars. - natural_
to_ dc_ number_ global - Converts a
Naturalnumber (with an optional negative sign flag) into a sequence of Global Graph IDs (DcList). - natural_
to_ dc_ number_ short - Converts a
Naturalnumber (with an optional negative sign flag) into a sequence of short Document Characters (Dcs). - parse_
dc_ number_ digits - Parses a slice of
DcChardigits (with optional leadingDC_NEGATIVEorDC_POSITIVEsign indicator, excluding the outerDC_BEGIN_NUMBER, format indicator, andDC_END_NUMBERdelimiters) into anInteger. - parse_
dc_ number_ digits_ with_ resolver - Parses a slice of
DcChardigits using the providedSyntaxRuleResolver. - parse_
dc_ number_ global - Parses an entire sequence of Global Graph IDs (
DcList) as a single Dc number. - parse_
dc_ number_ global_ i128 - Parses an entire sequence of Global Graph IDs (
DcList) as ani128. - parse_
dc_ number_ global_ with_ resolver - Parses an entire sequence of Global Graph IDs (
DcList) as a single Dc number using the providedSyntaxRuleResolver. - parse_
dc_ number_ short - Parses an entire sequence of short Document Characters (Dcs) as a single Dc number.
- parse_
dc_ number_ short_ i128 - Parses an entire sequence of short Document Characters (Dcs) as an
i128. - parse_
dc_ number_ short_ with_ resolver - Parses an entire sequence of short Document Characters (Dcs) as a single Dc number
using the provided
SyntaxRuleResolver. - read_
dc_ number_ from_ reader - Reads a single Dc number from a reader closure yielding
DcChars. - read_
dc_ number_ from_ reader_ with_ resolver - read_
dc_ number_ global - Reads a single Dc number from a slice of Global Graph IDs (
DcList), returning the parsedIntegerand the number of tokens consumed from the slice. - read_
dc_ number_ global_ with_ resolver - Reads a single Dc number from a slice of Global Graph IDs (
DcList) using the providedSyntaxRuleResolver. - read_
dc_ number_ short - Reads a single Dc number from a slice of short Document Characters (Dcs),
returning the parsed
Integerand the number of tokens consumed from the slice. - read_
dc_ number_ short_ with_ resolver - Reads a single Dc number from a slice of short Document Characters (Dcs)
using the provided
SyntaxRuleResolver. - short_
dc_ to_ base64_ char - Converts a single short Document Character (Dc) ID (127..=190, 195) into
its corresponding standard Base64 character or padding character (
=). - short_
dcs_ to_ base64_ str - Converts a sequence of short Document Characters (127..=190, 195) into a standard Base64 string.
- u128_
to_ dc_ number_ chars - Converts a
u128unsigned integer into a sequence ofDcChars. - u128_
to_ dc_ number_ global - Converts a
u128unsigned integer into a sequence of Global Graph IDs (DcList). - u128_
to_ dc_ number_ short - Converts a
u128unsigned integer into a sequence of short Document Characters (Dcs).