Function data_encoding::decode::decode [] [src]

pub fn decode<B: Base>(base: &B, input: &[u8]) -> Result<Vec<u8>, Error>

Generic decoding function with allocation.

This function is a wrapper for decode_mut that allocates an output of sufficient size using decode_len. The final size may be slightly smaller if input is padded.

Correctness

The base must satisfy the Base invariants.

Failures

Decoding may fail in the circumstances defined by Error.

Panics

May panic if base does not satisfy the Base invariants.