From 04dca7911ea255f37be799c18d74c305b921c1a6 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 4 Jul 2024 01:26:29 +0200 Subject: Call math.randomseed() without arguments to seed from system entropy. Reminder: the math.random() PRNG is NOT SUITABLE FOR CRYPTOGRAPHIC USE. --- doc/extensions.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc') 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. LuaJIT uses a Tausworthe PRNG with period 2^223 to implement math.random() and math.randomseed(). The quality of the PRNG results is much superior compared to the standard Lua -implementation, which uses the platform-specific ANSI rand(). +implementation, which uses the platform-specific ANSI rand().

The PRNG generates the same sequences from the same seeds on all @@ -276,6 +276,10 @@ It's correctly scaled up and rounded for math.random(n [,m]) to preserve uniformity.

+Call math.randomseed() without any arguments to seed it from +system entropy. +

+

Important: Neither this nor any other PRNG based on the simplistic math.random() API is suitable for cryptographic use.

-- cgit v1.2.3-55-g6feb