aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2024-07-04 01:26:29 +0200
committerMike Pall <mike>2024-07-04 01:26:29 +0200
commit04dca7911ea255f37be799c18d74c305b921c1a6 (patch)
tree0979ae369fbb82e7e5fb1c53fcf5cf5955c95f7b /doc
parent7421a1b33c7ea46f12bba9700c15b5c90253fee0 (diff)
downloadluajit-04dca7911ea255f37be799c18d74c305b921c1a6.tar.gz
luajit-04dca7911ea255f37be799c18d74c305b921c1a6.tar.bz2
luajit-04dca7911ea255f37be799c18d74c305b921c1a6.zip
Call math.randomseed() without arguments to seed from system entropy.
Reminder: the math.random() PRNG is NOT SUITABLE FOR CRYPTOGRAPHIC USE.
Diffstat (limited to 'doc')
-rw-r--r--doc/extensions.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/extensions.html b/doc/extensions.html
index c1c9a808..e9aaa096 100644
--- a/doc/extensions.html
+++ b/doc/extensions.html
@@ -265,7 +265,7 @@ and let the GC do its work.
265LuaJIT uses a Tausworthe PRNG with period 2^223 to implement 265LuaJIT uses a Tausworthe PRNG with period 2^223 to implement
266<tt>math.random()</tt> and <tt>math.randomseed()</tt>. The quality of 266<tt>math.random()</tt> and <tt>math.randomseed()</tt>. The quality of
267the PRNG results is much superior compared to the standard Lua 267the PRNG results is much superior compared to the standard Lua
268implementation, which uses the platform-specific ANSI rand(). 268implementation, which uses the platform-specific ANSI <tt>rand()</tt>.
269</p> 269</p>
270<p> 270<p>
271The PRNG generates the same sequences from the same seeds on all 271The PRNG generates the same sequences from the same seeds on all
@@ -276,6 +276,10 @@ It's correctly scaled up and rounded for <tt>math.random(n&nbsp;[,m])</tt> to
276preserve uniformity. 276preserve uniformity.
277</p> 277</p>
278<p> 278<p>
279Call <tt>math.randomseed()</tt> without any arguments to seed it from
280system entropy.
281</p>
282<p>
279Important: Neither this nor any other PRNG based on the simplistic 283Important: Neither this nor any other PRNG based on the simplistic
280<tt>math.random()</tt> API is suitable for cryptographic use. 284<tt>math.random()</tt> API is suitable for cryptographic use.
281</p> 285</p>