use super::{Alphabet, DecodeStep, EncodeStep};
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Base32;
impl Alphabet for Base32 {
const BASE: u8 = b'a';
const DECODER: &'static [DecodeStep] = DECODE_LOWER;
const ENCODER: &'static [EncodeStep] = ENCODE_LOWER;
const PADDED: bool = true;
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Base32Unpadded;
impl Alphabet for Base32Unpadded {
const BASE: u8 = b'a';
const DECODER: &'static [DecodeStep] = DECODE_LOWER;
const ENCODER: &'static [EncodeStep] = ENCODE_LOWER;
const PADDED: bool = false;
}
const DECODE_LOWER: &[DecodeStep] = &[DecodeStep(b'a'..=b'z', -96), DecodeStep(b'2'..=b'7', -23)];
const ENCODE_LOWER: &[EncodeStep] = &[EncodeStep(25, 73)];
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Base32Upper;
impl Alphabet for Base32Upper {
const BASE: u8 = b'A';
const DECODER: &'static [DecodeStep] =
&[DecodeStep(b'A'..=b'Z', -64), DecodeStep(b'2'..=b'7', -23)];
const ENCODER: &'static [EncodeStep] = &[EncodeStep(25, 41)];
const PADDED: bool = true;
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Base32UpperUnpadded;
impl Alphabet for Base32UpperUnpadded {
const BASE: u8 = b'A';
const DECODER: &'static [DecodeStep] =
&[DecodeStep(b'A'..=b'Z', -64), DecodeStep(b'2'..=b'7', -23)];
const ENCODER: &'static [EncodeStep] = &[EncodeStep(25, 41)];
const PADDED: bool = false;
}