logo
pub trait Encoding: Alphabet {
    fn decode(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8]>;
    fn decode_vec(input: &str) -> Result<Vec<u8>>;
    fn encode<'a>(src: &[u8], dst: &'a mut [u8]) -> Result<&'a str>;
    fn encode_string(input: &[u8]) -> String;
    fn encoded_len(bytes: &[u8]) -> usize;
}
Expand description

Core encoder/decoder functions for a particular Base32 alphabet

Required Methods

Decode a Base32-encoded string into the provided output buffer, returning a slice containing the decoded data.

Available on crate feature alloc only.

Decode a Base32 string into a byte vector.

Encode the input byte slice as Base32.

Writes the result into the provided destination slice, returning an ASCII-encoded Base32 string value.

Available on crate feature alloc only.

Encode input byte slice into a String containing Base32.

Get the length of Base32 produced by encoding the given bytes.

Implementors