TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Random Number Generator Recommendations for Applications

66 pointsby rdpintqogeogsaaalmost 2 years ago

8 comments

FabHKalmost 2 years ago
Useful.<p>One thing to keep in mind: there’s been a bit of a feud in the PRNG space between the Vigna camp [1] with xoroshiro and newcomer O’Neill [2] with PCG.<p>This website seems stay on the traditional side and shy away from recommending PCG. I’m not really qualified to judge on that dispute [3], but I think both options are better, smaller, faster than the good old Mersenne Twister, so it’s time that we moved on from that [4] and pick one of the latest generation PRNGs.<p>FWIW, Julia now uses xoshiro256++ by default [5], and they investigated their choice quite thoroughly, I believe.<p>[1] <a href="https:&#x2F;&#x2F;prng.di.unimi.it&#x2F;" rel="nofollow">https:&#x2F;&#x2F;prng.di.unimi.it&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;www.pcg-random.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.pcg-random.org&#x2F;</a><p>[3] <a href="https:&#x2F;&#x2F;pcg.di.unimi.it&#x2F;pcg.php" rel="nofollow">https:&#x2F;&#x2F;pcg.di.unimi.it&#x2F;pcg.php</a><p>And the reply <a href="https:&#x2F;&#x2F;www.pcg-random.org&#x2F;posts&#x2F;on-vignas-pcg-critique.html" rel="nofollow">https:&#x2F;&#x2F;www.pcg-random.org&#x2F;posts&#x2F;on-vignas-pcg-critique.html</a><p>[4] <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1910.06437" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1910.06437</a><p>[5] <a href="https:&#x2F;&#x2F;docs.julialang.org&#x2F;en&#x2F;v1&#x2F;stdlib&#x2F;Random&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.julialang.org&#x2F;en&#x2F;v1&#x2F;stdlib&#x2F;Random&#x2F;</a>
评论 #36134480 未加载
0cf8612b2e1ealmost 2 years ago
I am trying and failing to find an article where a poker website published their source code, including how they shuffled cards and seeded their randomness. The seed was the current timestamp. Someone realized an efficient way to reduce the search space, assuming vaguely accurate clocks, and predict every card distributed at the table after viewing only a small number of cards.
评论 #36213375 未加载
评论 #36134382 未加载
wepplealmost 2 years ago
This article fails to explain why someone should explicitly reach for an RNG over PRNG.<p>It also suggests os.urandom as a Python RNG which (as the name suggests) uses &#x2F;dev&#x2F;urandom or the getrandom() syscall, both of which are PRNGs
评论 #36133153 未加载
评论 #36133035 未加载
评论 #36132547 未加载
fastneutronalmost 2 years ago
All this, and the nuclear business is still using variants of LCGs from 60 years ago [1] for Monte Carlo simulations.<p>In this case, their speed, repeatability and “good enough” statistical properties haven’t motivated much to change.<p>1. <a href="https:&#x2F;&#x2F;www.osti.gov&#x2F;biblio&#x2F;976209" rel="nofollow">https:&#x2F;&#x2F;www.osti.gov&#x2F;biblio&#x2F;976209</a>
评论 #36133954 未加载
djbusbyalmost 2 years ago
If I&#x27;m using the random routines from libsodium is that good enough?
评论 #36132618 未加载
local_crmdgeonalmost 2 years ago
I wish the table of recommendations contained links. Searching some of those packages gives me sketchy deps I would not trust.
some_furryalmost 2 years ago
In PHP, at least, random_bytes() is faster than their &quot;high quality&quot; example.
评论 #36130786 未加载
rootw0rmalmost 2 years ago
nanorand for rust!<p>edit: now after reading about rand_xoshiro i&#x27;m curious to try it out