Crate basenc

Source
Expand description

§BaseNC

Encoding and decoding of Base-N encodings, #[no_std] compatible.

§Examples

Encoding:

let encoded = basenc::Base64Std.encode(b"hello world");
assert_eq!(encoded, "aGVsbG8gd29ybGQ");

Decoding:

let decoded = basenc::Base64Std.decode("aGVsbG8gd29ybGQ=").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 Padding::None as NoPad;

Modules§

incremental
Incremental processing

Structs§

Base32
Base32 alphabet.
Base64
Base64 alphabet.
Display
Display wrapper for encoding.
LowerHex
Hex charset using lower-case letters.
Ratio
Ratio between encoded and decoded lengths.
UpperHex
Hex charset using upper-case letters.
WithPad
Encoding with explicit padding policy.

Enums§

Error
Decoding error.
Padding
Padding policy.

Statics§

Base32Hex
Base32 Extended Hex alphabet.
Base32Std
Base32 RFC 4648 alphabet.
Base32Z
z-base-32 alphabet.
Base64Std
Base64 standard charset.
Base64Url
Base64 url-safe charset.

Traits§

DecodeBuf
Byte buffer receiving decoded input.
EncodeBuf
String buffer receiving encoded input.
Encoding
Data encoding.