Expand description
§BaseNC
Encoding and decoding of Base-N encodings, #[no_std]
compatible.
§Examples
Encoding:
let encoded = basenc::Base64Std.encode(b"hello world", basenc::Padding::Optional);
assert_eq!(encoded, "aGVsbG8gd29ybGQ");
Decoding:
let decoded = basenc::Base64Std.decode("aGVsbG8gd29ybGQ=", basenc::Padding::Optional).unwrap();
assert_eq!(decoded, b"hello world");
§Encoding
The hero of the show is Encoding
, defining the entry point for encoding and decoding for an encoding.
§Buffers
Buffers are types implementing the EncodeBuf
and DecodeBuf
traits.
Existing buffers can be reused with the encode_into
and decode_into
methods.
Re-exports§
pub use self::Padding::None as NoPad;
Modules§
- Incremental processing
Structs§
- Base32 alphabet.
- Base64 alphabet.
- Display wrapper for encoding.
- Hex charset using lower-case letters.
- Ratio between encoded and decoded lengths.
- Hex charset using upper-case letters.
Enums§
- Decoding error.
- Padding policy.
Statics§
- Base32 Extended Hex alphabet.
- Base32 RFC 4648 alphabet.
- z-base-32 alphabet.
- Base64 standard charset.
- Base64 url-safe charset.
Traits§
- Byte buffer receiving decoded input.
- String buffer receiving encoded input.
- Data encoding.