@@ -37,7 +37,7 @@ impl Alphabet for Base32Unpadded {
3737/// Lower-case Base32 decoder.
3838const DECODE_LOWER : & [ DecodeStep ] = & [ DecodeStep ( b'a' ..=b'z' , -96 ) , DecodeStep ( b'2' ..=b'7' , -23 ) ] ;
3939
40- /// Standard Base64 encoder
40+ /// Lower-case Base32 encoder
4141const ENCODE_LOWER : & [ EncodeStep ] = & [ EncodeStep ( 25 , 73 ) ] ;
4242
4343/// RFC4648 upper case Base32 encoding with `=` padding.
@@ -51,9 +51,8 @@ pub struct Base32Upper;
5151
5252impl Alphabet for Base32Upper {
5353 const BASE : u8 = b'A' ;
54- const DECODER : & ' static [ DecodeStep ] =
55- & [ DecodeStep ( b'A' ..=b'Z' , -64 ) , DecodeStep ( b'2' ..=b'7' , -23 ) ] ;
56- const ENCODER : & ' static [ EncodeStep ] = & [ EncodeStep ( 25 , 41 ) ] ;
54+ const DECODER : & ' static [ DecodeStep ] = DECODE_UPPER ;
55+ const ENCODER : & ' static [ EncodeStep ] = ENCODE_UPPER ;
5756 const PADDED : bool = true ;
5857}
5958
@@ -68,8 +67,13 @@ pub struct Base32UpperUnpadded;
6867
6968impl Alphabet for Base32UpperUnpadded {
7069 const BASE : u8 = b'A' ;
71- const DECODER : & ' static [ DecodeStep ] =
72- & [ DecodeStep ( b'A' ..=b'Z' , -64 ) , DecodeStep ( b'2' ..=b'7' , -23 ) ] ;
73- const ENCODER : & ' static [ EncodeStep ] = & [ EncodeStep ( 25 , 41 ) ] ;
70+ const DECODER : & ' static [ DecodeStep ] = DECODE_UPPER ;
71+ const ENCODER : & ' static [ EncodeStep ] = ENCODE_UPPER ;
7472 const PADDED : bool = false ;
7573}
74+
75+ /// Lower-case Base32 decoder.
76+ const DECODE_UPPER : & [ DecodeStep ] = & [ DecodeStep ( b'A' ..=b'Z' , -64 ) , DecodeStep ( b'2' ..=b'7' , -23 ) ] ;
77+
78+ /// Upper-case Base32 encoder
79+ const ENCODE_UPPER : & [ EncodeStep ] = & [ EncodeStep ( 25 , 41 ) ] ;
0 commit comments