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", 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§

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§

Statics§

Traits§