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 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 75,000,000 random blocks (about 1 TB) retrieved from a SwiftRNG Pro device (one block equals to 16,000 bytes):

sudo bitcount 75000000 0

This could result in the following output:

--- A program for counting '1' and '0' bits downloaded from SwiftRNG device ---

SwiftRNG device number 0 open successfully

*** downloading random bytes and counting bits using 'no' post processing method ***
total bytes downloaded 1200000000000, 0 bit count: 4799999305642, 1 bit count: 4800000694358, diff: -1388716

In the output shown above you will notice a discrepancy between 0’s and 1’s counts. The generator produced more 1’s bits than 0’s bits, however that discrepancy is small and can be ignored. A tiny bias or a small error in the random source would have resulted in a huge discrepancy in those counts for 1 TB of random data.

For Linux and macos, 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.