Expand description
Base conversion
Structs§
- Base
- Represents a mathematical integer base / radix (e.g. 1, 2, 8, 10, 16, 64).
- Base
Conversion Padding Mode - Zero-padding configuration for delimited base string conversion.
- Base
String Format Settings - Settings for parsing and formatting delimited strings of numbers across bases.
- Numeral
System - Represents a numeral system defined by a mathematical radix and a digit alphabet.
Enums§
- Base
Alphabet - Alphabet used by a numeral system.
Functions§
- base_
to_ base_ string - Parse a string containing numbers in base 2 through 64, 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 - Convenience function to convert a delimited string of decimal numbers to hexadecimal using default format settings.
- format_
base_ string - Parse a string containing numbers in base 2 through 64 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 - Convenience function to convert a delimited string of hexadecimal numbers to decimal using default format settings.
- 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_ big_ alphabet - Returns the integer represented by n in the requested base using the given alphabet.
- 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.
- int_
to_ base_ str_ big_ alphabet - Returns the string representation of an arbitrary-precision integer in the requested base and alphabet.
- is_
base_ digit - Returns true if the single-character string is a valid digit in the standard alphabet for the given base.
- is_
base_ digit_ alphabet - Returns true if the character is a valid digit for the given base in the specified alphabet.
- is_
base_ str - Returns true if all characters in the string are valid digits in the standard alphabet for the given base.
- is_
base_ str_ alphabet - Returns true if all characters in the string are valid digits for the given base in the specified alphabet.
- is_
supported_ base - Returns true if the base is supported by the standard alphanumeric alphabet (1..=36).