Available for Windows, macOS and Linux, bitcount is a utility that can be used to count the number of 0 and 1 bits in a random byte stream generated by a SwiftRNG device or by reading bytes from a file for quality verification.

An ideal generator will produce an equal amount of 0 and 1 bits over a period of time; however that is rarely achievable when using real random number generators.

The following command demonstrates how to count ones and zeros for 750,000 random blocks (about 12 GB) retrieved from a SwiftRNG Pro device (one block equals to 16,000 bytes):

sudo bitcount 750000 0

This could result in the following output:

----------------------------------------------------------------------------
---  A program for counting bits retrieved from SwiftRNG or from a file  ---
----------------------------------------------------------------------------

SwiftRNG device number 0 open successfully

*** downloading random bytes and counting bits, post-processing: none, embedded correction: none ***
retrieved 96000000000 total bits, 0's bit count: 48000185752, 1's bit count: 47999814248, 
0's arithmetic mean: 0.5000019349

The following command demonstrates how to count ones and zeros of the random bytes provided by randombytes.bin file:

bitcount -fn randombytes.bin

This could result in the following output:

----------------------------------------------------------------------------
---  A program for counting bits retrieved from SwiftRNG or from a file  ---
----------------------------------------------------------------------------
*** reading bytes and counting bits from file: randombytes.bin ***
retrieved 9600000000 total bits, 0's bit count: 4799981594, 1's bit count: 4800018406, 
0's arithmetic mean: 0.4999980827

A new bitcount-cl utility is available four counting 0’s and 1’s bits in a random byte stream that is generated by a cluster of multiple SwiftRNG devices.