/// Returns the minimum number of bytes needed to encode the `value` without leading zeroes in
/// big-endian representation.
Returns the minimum number of bytes needed to encode the `value` without leading zeroes in
big-endian representation.
Returns the minimum number of bytes needed to encode the ` value ` without leading zeroes in big - endian representation .
pub const fn predict_var_uint_size(value: u64) -> u8 {
    // avoid branching on zero by always orring one; it will not have any effect on other inputs
    let value = value | 1;
    // this will be now be 0..=63 as we handled the zero away
    let highest_bit = 64 - value.leading_zeros();
    // do a highest_bit.ceiling_div(8)
    ((highest_bit + 8 - 1) / 8) as u8
}
pub const fn predict_var_uint_size ( value : u64 ) -> u8 { // avoid branching on zero by always orring one; it will not have any effect on other inputs let value = value | 1 ; // this will be now be 0..=63 as we handled the zero away let highest_bit = 64 - value . leading_zeros ( ) ; // do a highest_bit.ceiling_div(8) ( ( highest_bit + 8 - 1 ) / 8 ) as u8 }
Returns the minimum number of bytes needed to encode the `value` without leading zeroes in
big-endian representation.
Returns the minimum number of bytes needed to encode the ` value ` without leading zeroes in big - endian representation .
value
u64