decode
fn decode(string s) -> Result<Vec<byte>, string> Import
Source: use encoding::{decode}; src/encoding.hy Decodes standard Base64 text into bytes.
Parameters#
| Name | Type |
|---|---|
s | string |
Returns#
Result<Vec<byte>, string>
Errors#
Returns Err when s has a character outside the Base64 alphabet or a length that is not a multiple of 4.
Examples#
use encoding::{decode, encode};
use tests::assert;
let bytes = decode("aGVsbG8=") ?? Vec::new();
assert!(bytes.len() == 5);
assert!(encode(bytes) == "aGVsbG8=");
See also#
encode: Encodesdataas standard Base64 (RFC 4648 alphabet, with=padding).