base64_decode
Decodes s from base64 (RFC 4648 section 4).
Import
Section titled “Import”Cargo feature hex (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
s | &str | The base64 string to decode, with = padding to a multiple of 4 characters. |
Returns
Section titled “Returns”Result<Vec<u8>, Base64DecodeError> — Ok on success, otherwise an Err: see Errors.
Errors
Section titled “Errors”Returns a Base64DecodeError when the length is not a multiple of 4, = appears anywhere
but the end, or a character is not in the base64 alphabet.
Examples
Section titled “Examples”Error type: Base64DecodeError
Section titled “Error type: Base64DecodeError”Why a string could not be decoded as base64.
