base64ct/alphabet/
crypt.rs1#![allow(deprecated)]
4
5use super::{Alphabet, DecodeStep, EncodeStep};
6
7#[deprecated(
19 since = "1.8.2",
20 note = "non-standard encoding. Use Base64ShaCrypt for all crypt(3) algorithms"
21)]
22#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
23pub struct Base64Crypt;
24
25impl Alphabet for Base64Crypt {
26 const BASE: u8 = b'.';
27
28 const DECODER: &'static [DecodeStep] = &[
29 DecodeStep::Range(b'.'..=b'9', -45),
30 DecodeStep::Range(b'A'..=b'Z', -52),
31 DecodeStep::Range(b'a'..=b'z', -58),
32 ];
33
34 const ENCODER: &'static [EncodeStep] =
35 &[EncodeStep::Apply(b'9', 7), EncodeStep::Apply(b'Z', 6)];
36
37 const PADDED: bool = false;
38
39 type Unpadded = Self;
40}