Expand description
Bit calculations.
These provide a single place to handle bits-to-bytes conversions and the u32/usize
discrepancy that can only be solved by panics or casting.
Functionsยง
- from_
bytes ๐ - Calculate a
u32representing a number of bits from the given number of bytes as ausize. - from_
limbs ๐ - Calculate a
u32representing a number of bits in an integer with the given number of limbs. - mul ๐
- to_
bytes ๐ - Calculate a
usizerepresenting the number of bytes required to store the given number of bits represented as au32(i.e. rounding up). - to_
limbs ๐ - Calculate a
usizerepresenting the number of limbs required to store the given number of bits represented as au32(i.e. rounding up). - u32_
to_ ๐usize - usize_
to_ ๐u32