Examples Basic example catch { let decoded = bs58::decode("he11owor1d").into_vec()?; let encoded = bs58::encode(decoded).into_string(); assert_eq!("he11owor1d", encoded); } Changing the alphabet catch { let decoded = bs58::decode("he11owor1d") .with_alphabet(bs58::alphabet::RIPPLE) .into_vec()?; let encoded = bs58::encode(decoded) .with_alphabet(bs58::alphabet::FLICKR) .into_string(); assert_eq!("4DSSNaN1SC", encoded); } Decoding into an existing buffer catch { let (mut decoded, mut encoded) = ([0xFF; 8], String::with_capacity(10)); bs58::decode("he11owor1d").into(&mut decoded)?; bs58::encode(decoded).into(&mut encoded); assert_eq!("he11owor1d", encoded); }
Examples Basic example let decoded = bs58::decode("he11owor1d").into_vec()?; let encoded = bs58::encode(decoded).into_string(); assert_eq!("he11owor1d", encoded); Changing the alphabet let decoded = bs58::decode("he11owor1d") .with_alphabet(bs58::alphabet::RIPPLE) .into_vec()?; let encoded = bs58::encode(decoded) .with_alphabet(bs58::alphabet::FLICKR) .into_string(); assert_eq!("4DSSNaN1SC", encoded); Decoding into an existing buffer let (mut decoded, mut encoded) = ([0xFF; 8], String::with_capacity(10)); bs58::decode("he11owor1d").into(&mut decoded)?; bs58::encode(decoded).into(&mut encoded); assert_eq!("he11owor1d", encoded);