Skip to main content

encoded_length

Function encoded_length 

Source
pub const fn encoded_length(bytes_len: usize, padding: bool) -> Option<usize>
Expand description

Returns the size in bytes of the input data after base32 encoding.

Returns None if the output size overflows usize.

ยงExample

assert_eq!(base32::encoded_length(5, true), Some(8));
assert_eq!(base32::encoded_length(1, false), Some(2));
assert_eq!(base32::encoded_length(usize::MAX, true), None);