Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So the question now is, if it were calling `crypto.getRandomValues()` instead, would it sound different?

EDIT:

This is not a 100% joke question. I'd expect both versions to sound the same, but at the same time, there's a threshold on the RNG spectrum between "getRandomNumber() { return 4; }" and some truly random quantum source, where if you feed the RNG to audio output, people will be able to distinguish between "bad RNGs" (left of threshold), and "good RNGs" (right of threshold). I wonder where that threshold falls.



It wouldn't sound different, even if you have absolute pitch, whatever the "speed" of the random sounds would be.

Both algorithms will generate sufficiently random values from a human perspective. Unless you carefully look into them, with a very specific mathematics / crypto knowledge, you wouldn't even be able to tell which one is pseudo-random, and which one is random: and if you somehow are able to, then it would just mean that the underlying RNG is very, very bad.


Probably not different enough that you could pick one from the other without a lot of practice, but depending on what PRNG you use, there's a good chance there's repeating patterns at different frequencies in the lower bits. Take a look at the visualisation bitmaps in https://www.random.org/analysis/ - I'd guess there's enough structure in that signal to appear in the 'white noise' as an audible whine.


> would it sound different?

I don't believe it would. While there can be pretty bad PRNGs, they are typically implemented to produce a particular statistical distribution which would be identical to a real random source for the purposes of white noise. This is due to the fact that audio is a superposition of frequencies which takes time and multiple samples to cohere.

PRNGs can be bad for things like crypto because each individual generated value has significant implications for the entire set of operations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: