pub fn decode<T: AsRef<str>>(input: T, strict: bool) -> Result<(Base, Vec<u8>)>Expand description
Decode the base string.
§Examples
use multi_base::{Base, decode};
assert_eq!(
decode("zCn8eVZg", true).unwrap(),
(Base::Base58Btc, b"hello".to_vec())
);§Errors
Returns an error if:
- The input string is empty (
Error::EmptyInput) - The base code prefix is unknown (
Error::UnknownBase) - The encoded data is invalid for the detected base