-------------- /dev/urandom, three examples --------------- $ ./ent test-data.bin Entropy = 7.999852 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 246.70, and randomly would exceed this value 63.39 percent of the times. Arithmetic mean value of data bytes is 127.5113 (127.5 = random). Monte Carlo value for Pi is 3.141440000 (error 0.00 percent). Serial correlation coefficient is 0.001363 (totally uncorrelated = 0.0). $ ./ent test-data.bin Entropy = 7.999862 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 229.94, and randomly would exceed this value 86.83 percent of the times. Arithmetic mean value of data bytes is 127.5452 (127.5 = random). Monte Carlo value for Pi is 3.136740000 (error 0.15 percent). Serial correlation coefficient is 0.000230 (totally uncorrelated = 0.0). $ ./ent test-data.bin Entropy = 7.999858 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 235.79, and randomly would exceed this value 80.05 percent of the times. Arithmetic mean value of data bytes is 127.4407 (127.5 = random). Monte Carlo value for Pi is 3.138140000 (error 0.11 percent). Serial correlation coefficient is -0.000313 (totally uncorrelated = 0.0). -------------- fallback code, three examples. hash('sha256', mt_rand() . uniqid() . mt_rand(), TRUE); --------------- $ ./ent test-data2.bin Entropy = 7.999840 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 266.31, and randomly would exceed this value 30.04 percent of the times. Arithmetic mean value of data bytes is 127.5552 (127.5 = random). Monte Carlo value for Pi is 3.140700000 (error 0.03 percent). Serial correlation coefficient is 0.000774 (totally uncorrelated = 0.0). $ ./ent test-data2.bin Entropy = 7.999860 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 232.97, and randomly would exceed this value 83.53 percent of the times. Arithmetic mean value of data bytes is 127.5656 (127.5 = random). Monte Carlo value for Pi is 3.139720000 (error 0.06 percent). Serial correlation coefficient is 0.001235 (totally uncorrelated = 0.0). $ ./ent test-data2.bin Entropy = 7.999846 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 0 percent. Chi square distribution for 1200000 samples is 255.30, and randomly would exceed this value 48.29 percent of the times. Arithmetic mean value of data bytes is 127.4155 (127.5 = random). Monte Carlo value for Pi is 3.141080000 (error 0.02 percent). Serial correlation coefficient is 0.000303 (totally uncorrelated = 0.0). -------------- previous patch code, three examples. hash('sha256', uniqid(mt_rand(), TRUE)) . md5(uniqid(mt_rand(), TRUE); --------------- $ ./ent test-data3.bin Entropy = 3.999993 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 50 percent. Chi square distribution for 1200000 samples is 18000183.85, and randomly would exceed this value less than 0.01 percent of the times. Arithmetic mean value of data bytes is 70.1228 (127.5 = random). Monte Carlo value for Pi is 4.000000000 (error 27.32 percent). Serial correlation coefficient is 0.001712 (totally uncorrelated = 0.0). $ ./ent test-data3.bin Entropy = 3.999987 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 50 percent. Chi square distribution for 1200000 samples is 18000350.26, and randomly would exceed this value less than 0.01 percent of the times. Arithmetic mean value of data bytes is 70.1251 (127.5 = random). Monte Carlo value for Pi is 4.000000000 (error 27.32 percent). Serial correlation coefficient is 0.000610 (totally uncorrelated = 0.0). $ ./ent test-data3.bin Entropy = 3.999993 bits per byte. Optimum compression would reduce the size of this 1200000 byte file by 50 percent. Chi square distribution for 1200000 samples is 18000199.00, and randomly would exceed this value less than 0.01 percent of the times. Arithmetic mean value of data bytes is 70.1536 (127.5 = random). Monte Carlo value for Pi is 4.000000000 (error 27.32 percent). Serial correlation coefficient is 0.000621 (totally uncorrelated = 0.0).