Hacker News new | ask | show | jobs
by pantantrant 849 days ago
I changed the printf line of code to this (printf("%2x", integer);) to make it a pseudorandom number generator and made a post about it https://news.ycombinator.com/item?id=39462913 (10 Lines of code 3.4 bits of noise per byte weak pseudo random number generator)

I compiled it, ran ./vitalixprng &> output.txt and then ran Detect It Easy's entropy measuring tool on output.txt to give me around 3.41 bits of randomness per 8 bits.

It outputs 2 hex characters (hex character = half byte = 4 bits) per clock cycle.

It gives out pseudorandom output that looks like this:

28595827262617506937569201755869372950673748294758392

1 comments

I still don't understand how it's a pseudo-random number generator. you're still outputting `integer`, you're just using %u instead of %2f - instead of a floating point number, it's an unsigned integer, right? (I haven't used C/printf in awhile.)

And the measure of entropy means nothing. If I know that the last number that was output was 10, I know the following number will be 15.