encodedLen
Returns the length of the encoded base64 string for a given length.
Function parameters
Parameters
(best-effort) constant time hexadecimal encoding and decoding.
Types
Error sets in this namespace
Error Sets
Source
Implementation
pub fn encodedLen(bin_len: usize, variant: Variant) usize {
if (variant.padding) {
return (bin_len + 2) / 3 * 4;
} else {
const leftover = bin_len % 3;
return bin_len / 3 * 4 + (leftover * 4 + 2) / 3;
}
}