1 //! bcrypt Base64 encoding.
3 use super::{Alphabet, DecodeStep, EncodeStep}
;
5 /// bcrypt Base64 encoding.
8 /// ./ [A-Z] [a-z] [0-9]
9 /// 0x2e-0x2f, 0x41-0x5a, 0x61-0x7a, 0x30-0x39
11 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
12 pub struct Base64Bcrypt
;
14 impl Alphabet
for Base64Bcrypt
{
15 const BASE
: u8 = b'
.'
;
17 const DECODER
: &'
static [DecodeStep
] = &[
18 DecodeStep
::Range(b'
.'
..=b'
/'
, -45),
19 DecodeStep
::Range(b'A'
..=b'Z'
, -62),
20 DecodeStep
::Range(b'a'
..=b'z'
, -68),
21 DecodeStep
::Range(b'
0'
..=b'
9'
, 7),
24 const ENCODER
: &'
static [EncodeStep
] = &[
25 EncodeStep
::Apply(b'
/'
, 17),
26 EncodeStep
::Apply(b'Z'
, 6),
27 EncodeStep
::Apply(b'z'
, -75),
30 const PADDED
: bool
= false;