Random: CRC32

The 32 bit CRC polynomial 0xEDB88320 is a good quality very small random number generator.  Unfortunately, the simple loop version is also very slow.

Size

CRC32 adds a very modest 104 bytes to the image which is significantly less than the 454 bytes added by the Libc random function.

Speed

On a 1 MHz ATtiny85 processor CRC32 takes 0.610 milliseconds to generate the next value which is significantly faster than the 1.947 milliseconds taken by the Libc random function.

Quality

On the dieharder tests, CRC32 always fails one test: diehard_rank_32x32.

References

Status

Matches Delphi.

Leave a Reply