Function bs58::decode::decode_into [] [src]

pub fn decode_into(
    input: &[u8],
    output: &mut [u8],
    alpha: &[u8; 58]
) -> Result<usize, DecodeError>

Decode given string into given byte slice using the given alphabet.

Returns the length written into the byte slice, the rest of the bytes in the slice will be left untouched.

This is the low-level implementation that the DecodeBuilder uses to perform the decoding, it's very likely that the signature will change if the major version changes.

Examples

let input = "he11owor1d";
let mut output = [0; 8];
bs58::decode::decode_into(input.as_ref(), &mut output, bs58::alphabet::DEFAULT);
assert_eq!([0x04, 0x30, 0x5e, 0x2b, 0x24, 0x73, 0xf0, 0x58], output);