vendredi 26 décembre 2014

Encode integers into binary stream for random test

I want to test the randomness of a sequence of generated integers. The integers are of range [1, 55440]. I'm using the NIST randomness test suite (http://csrc.nist.gov/rng). Since the NIST test suite only accepts binary streams, I must convert the integers to a binary stream.


I cannot use the binary representation of those integers directly, because of the range of the integers. 55440 is less than 65536 = 2^16, so the most significant bit of the binary representation is more likely to be 0, which may cause false negatives.


How should those integer be encoded for NIST test ?





Aucun commentaire:

Enregistrer un commentaire