Hacker News new | ask | show | jobs
by whispering 1469 days ago
Author here!

The numbers are generated directly from the current timer/counter value at the moment of the event. I'm not at all measuring time BETWEEN events. It's just a counter that overflows ~300 times per second (20MHz clock in a 16 bit counter), while the radioactive events happen every ~1-3 seconds. This ensures that the numbers are uniformly distributed and uncorrelated.

I am actually throwing away some enthropy bits doing this, as there will be significant bits to the left that i'm discarding. A somewhat next step in the future could be the assesment of how many bits can the counter be, without impacting the quality of the output. Maybe i can get something like 20 bits per event.

1 comments

IANA cryptographer. But it seems like this results in readings not being truly independent.

Also I feel like there might be some element of nonuniformity, akin to generating a number out of n possible values, and modding it by k, where n is not divisible by k. n and k being the timer period and event in this analogy.

That would be the case if i was resetting the counter at every read. Instead, it does not reset the counter, so it does not always start from 0. So the analogy would hold only for the very first number.

Btw here is a sample of the data gathered, if you want to further analyze it. It's plain binary: https://github.com/valerionew/Banana-Random-Number-Generator...