Function bs58::encode::encode_into [] [src]

pub fn encode_into(input: &[u8], output: &mut String, alpha: &[u8; 58])

Encode given bytes into given string using the given alphabet, any existing data will be cleared.

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

Examples

let input = [0x04, 0x30, 0x5e, 0x2b, 0x24, 0x73, 0xf0, 0x58];
let mut output = "goodbye world".to_owned();
bs58::encode::encode_into(&input[..], &mut output, bs58::alphabet::DEFAULT);
assert_eq!("he11owor1d", output)