Module base

Source
Expand description

Base conversion

Structs§

BaseConversionPaddingMode
BaseStringFormatSettings

Functions§

_format_base_string
_parse_base_string 🔒
Converts all characters that match the requested base into the target base. It will leave other characters alone, so you can convert a list of numbers. It allows hex input numbers like 0x1A.
base_to_base_string
Parse a string contaning numbers in base 2 through 36, convert it to the target base, and print it formatted. Will warn for extra characters other than spaces and commas.
casefold_base_chars_in_string
char_from_hex_byte
Convert two hex digits to a single byte -> char (StageL: charFromHexByte) StageL operated on bytes, not Unicode scalar validation beyond 0xFF.
dec_to_hex_single
dec_to_hex_string
format_base_string
Parse a string contaning numbers in base 2 through 36, and print it formatted. Will warn for extra characters other than spaces and commas.
get_digits_needed
hex_to_dec_single
hex_to_dec_string
int_from_base36_char
Returns an int given the nth digit in base 36 or less (using capitalized digits).
int_from_base_str_big
Returns the integer represented by n in the requested base.
int_from_base_str_u32
Returns the integer represented by n in the requested base.
int_from_base_str_u128
Returns the integer represented by n in the requested base.
int_to_base36_char
Returns the nth digit in base 36 or less (using capitalized digits). The original JS version had a bug where it would accept 36 as a base, when 0 to 35 is expected (36 digits).
int_to_base_str
Returns the integer represented by n in the requested base.
is_base_digit
is_base_str
is_supported_base