botan.utils.bit_ops

Bit/Word Operations

Members

Functions

ctz
size_t ctz(T n)

Count the trailing zero bits in n

hammingWeight
size_t hammingWeight(T n)

Compute Hamming weights

highBit
size_t highBit(T n)

Return the index of the highest set bit T is an uinteger type

isPowerOf2
bool isPowerOf2(T arg)

Power of 2 test. T should be an uinteger type

lowBit
size_t lowBit(T n)

Return the index of the lowest set bit T is an uinteger type

significantBytes
size_t significantBytes(T n)

Return the number of significant bytes in n

Meta

License

Botan is released under the Simplified BSD License (see LICENSE.md)