This commit replaces the template function `CountBitsInMask<UintType>`
with a non-template function `CountBitsInMask(uint32_t)` in `bit_utils.hpp`
and moves its implementation to `bit_utils.cpp`.
Un-inlining this helper function avoids template instantiation overhead
and reduces binary size across translation units. Small integer arguments
(`uint8_t`, `uint16_t`) automatically promote to `uint32_t`, preserving
existing functionality.
This commit adds `DetermineMinBitSizeFor(uint32_t)` to calculate and
return the minimum number of bits required to represent a given
32-bit unsigned integer value.
It also adds unit tests for this in `test_bit_utils.cpp`.
This change introduces a new utility function `CountMatchingBits()` to
calculate the number of matching leading bits between two byte
arrays.
This new fn replaces the now-removed `Ip6::Prefix::MatchLength()`.
The previous implementation was specific to the `Ip6::Prefix`
class. The new generic function is placed in `common/bit_utils` and
is used to update `Ip6::Prefix`, `Ip6::Address`, `Ip4::Cidr`, and
`PrefixTlv`.
A new unit test `test_bit_utils` is added with comprehensive tests for
the new function. The existing tests for `CountBitsInMask` are also
moved into this new test file.