20 int numBits = (
sizeof(uint32_t) * 8);
21 int maxBitIndex = numBits - 1;
23 std::vector<char> buffer;
24 buffer.resize(numBits + 1);
26 for (
int bitIndex = maxBitIndex; bitIndex >= 0; bitIndex--)
28 buffer[bitIndex] = (number & mask) ?
'1' :
'0';
31 return std::string(&buffer[0]);
Declaration of the uint32_to_binary() function, that converts a 32-bit unsigned integer to a binary s...
The namespace containing all the "helper" functions in the C++ code.
std::string uint32_to_binary(uint32_t number)
Function to convert a 32-bit unsigned integer into a string representation containing all 32 bits.