Function awint_internals::bits_upper_bound [−][src]
pub fn bits_upper_bound(len: usize, radix: u8) -> Result<usize, SerdeError>
Expand description
This is used for quickly calculating the maximum number of bits
needed for a string representation of a number in some radix to be
represented. This may give more bits than needed, but is guaranteed to never
underestimate the number of bits needed.
Returns None
if we see memory exhaustion