Function big_int::base64_decode

source ·
pub fn base64_decode(
    b64_string: impl Into<String>
) -> Result<Vec<u8>, BigIntError>
Expand description

Decode a base64 string into an array of bytes.

Note: probably slower than using a standalone library to perform this conversion. However, again, it’s very neat c:

Note: may fail if the data begins with zeros.

use big_int::*;
assert_eq!(base64_decode("SGVsbG8gd29ybGQh").unwrap(), b"Hello world!");