1
/// Returns the number of bits needed to represent the given value.
2
38497500
pub fn bits_for_value(value: usize) -> u8 {
3
38497500
    if value == 0 {
4
        return 1;
5
38497500
    }
6

            
7
38497500
    value.ilog2() as u8 + 1
8
38497500
}