瀏覽代碼

Add note about the unsuitabilty of math.random() for crypto.

Mike Pall 5 年之前
父節點
當前提交
a75d13c63a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      doc/extensions.html

+ 4 - 0
doc/extensions.html

@@ -212,6 +212,10 @@ for every call. The result is uniformly distributed between 0.0 and 1.0.
 It's correctly scaled up and rounded for <tt>math.random(n&nbsp;[,m])</tt> to
 preserve uniformity.
 </p>
+<p>
+Important: Neither this nor any other PRNG based on the simplistic
+<tt>math.random()</tt> API is suitable for cryptographic use.
+</p>
 
 <h3 id="io"><tt>io.*</tt> functions handle 64&nbsp;bit file offsets</h3>
 <p>