18 if (buffer != NULL && bufferSize > 32)
20 int numBits = (
sizeof(uint32_t) * 8);
21 int maxBitIndex = numBits - 1;
24 memset(buffer, 0, bufferSize);
25 if ((
size_t)maxBitIndex >= bufferSize)
27 maxBitIndex = (int)(bufferSize - 1);
29 for (
int bitIndex = maxBitIndex; bitIndex >= 0; bitIndex--)
31 buffer[bitIndex] = (number & mask) ?
'1' :
'0';
Declaration of the uint32_to_binary() function, that converts a 32-bit unsigned integer to a binary s...
void uint32_to_binary(uint32_t number, char *buffer, size_t bufferSize)
Function to convert a 32-bit unsigned integer into a string representation containing all 32 bits.