bin-encode-decode 11.0.0

A high-performance binary encode and decode library that supports customizable character sets beyond Base64.
Documentation
/// Standard length for character sets used in encoding/decoding.
///
/// Represents the required number of unique characters (64) for base64-like encoding.
pub(crate) const CHARSET_LEN: usize = 64;

/// Size of the byte lookup table used for O(1) ASCII decoding.
pub(crate) const DECODE_LUT_LEN: usize = 256;

/// Sentinel value marking empty slots in the Unicode decode hash table.
pub(crate) const UNICODE_EMPTY_SLOT: usize = usize::MAX;

/// Sentinel value marking bytes absent from the active exact-length ASCII decoding charset.
pub(crate) const INVALID_DECODE_VAL: u8 = 0xFF;

/// Sentinel value marking bytes absent from a variable-length ASCII decoding charset.
pub(crate) const INVALID_DECODE_INDEX: usize = usize::MAX;

/// Bitmask selecting the lower 6 bits of a byte.
pub(crate) const SIX_BIT_MASK: u8 = 0x3F;

/// Sentinel placeholder char used when initializing fixed-size Unicode tables.
pub(crate) const NULL_CHAR: char = '\0';

/// Power-of-two slot count for the stack open-addressing Unicode decode table.
pub(crate) const UNICODE_HASH_SLOTS: usize = 128;

/// Bitmask for indexing into the Unicode decode hash table.
pub(crate) const UNICODE_HASH_MASK: usize = UNICODE_HASH_SLOTS - 1;

/// Fibonacci hashing multiplier for Unicode scalar values.
pub(crate) const UNICODE_HASH_MULT: u32 = 0x9E37_79B9;

/// Empty string literal used as the default unset charset.
pub(crate) const EMPTY_STR: &str = "";