Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Random access noise – counter-based pseudo-random number generator (frama.io)
20 points by joelkp on March 27, 2022 | hide | past | favorite | 3 comments



If I'm not mistaken, SplitMix64 does this, too. Its update function is a simple addition, so random access is just a matter of multiplication. All the randomness is provided by the mixing function (which uses XORs, bitshifts, and multiplies).


I've looked around more, and I should probably write a better/fuller comparison of other things with what I experiment with. I think the more unusual thing, and useful observation, is that multiplying with the result of a varying bitrotation (what I thought of as "chaotic waveshaping") can be enough to make it sound like white noise (though more is needed to make all bits decently random). It makes it possible to use a multiplication less.

SplitMix64 uses another multiplication and only fixed bitshifts, and is 64-bit. I've found more about the standard form of its core - a permuting hash function with two multiplications and three xor-right-shifts. There are also 32-bit functions of that type, where the best seem to be listed in this article on the topic: https://nullprogram.com/blog/2018/07/31/


Maybe it's not so interesting to readers here, audio remaining the main purpose for which it was made. The days after posting, tests and tweaks have however made it better for general purposes. New code and stats now included, more to come.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: