Trait basenc::Encoding [] [src]

pub trait Encoding {
    fn alphabet(self) -> &'static str;
    fn encode<B: EncodeBuf>(self, bytes: &[u8], buffer: B) -> B::Output;
    fn decode<B: DecodeBuf>(
        self,
        string: &str,
        buffer: B
    ) -> Result<B::Output, Error>; }

Data encoding.

Use the free-standing functions to avoid having to drag in this trait.

Required Methods

Returns the encoding's alphabet.

Examples

use basenc::{Encoding};

assert_eq!(
    basenc::LowerHex.alphabet(),
    "0123456789abcdef"
);

Directly encode into an encode buffer.

Use encode for convenience.

Directly decode into a decode buffer.

Use decode for convenience.

Implementors