Expand description
Encoding functionality.
This module provides functions to encode data to Base64.
There are also try_length
and length
functions to calculate the
length of the encoded data.
§Examples
use pkce_std::encoding::{encode, length};
let data = "Hello, world!";
let encoded = encode(data);
assert_eq!(encoded.len(), length(data.len()));
Constants§
- OVERFLOW
- The
overflow
literal.
Functions§
- encode
- Encodes given data into Base64.
- length
- Calls
try_length
and panics if the result isNone
. - try_
length - Computes the length of the Base64 encoded data from the given length.