pub(crate) static ENCODED_TO_UTF8_MAP: &[u8; 60] =
b"0123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
pub(crate) static UTF8_TO_ENCODED_MAP: &[u8; 123] = &[
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255,
255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 16, 17, 255, 18, 19, 20, 21, 22, 255, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 255, 255, 255, 255, 255, 255, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
];
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_reverse_mapping() {
for (index, c) in ENCODED_TO_UTF8_MAP.iter().enumerate() {
let utf8 = UTF8_TO_ENCODED_MAP[*c as usize];
assert_eq!(index, utf8 as usize, "Incorrect for {}", c)
}
}
}