diff --git a/index.html b/index.html index 51a9625..4d0d2d8 100644 --- a/index.html +++ b/index.html @@ -677,12 +677,14 @@ a.equals(b) // true

If the value of this Decimal constructor's crypto property is true, and the - crypto object is available in the host environment, the random digits of the - return value are generated by either crypto.getRandomValues (Web Cryptography API - in modern browsers) or crypto.randomBytes (Node.js), otherwise, if the the value - of the property is false the return value is generated by + crypto object is available globally in the host environment, the random digits of + the return value are generated by either crypto.getRandomValues (Web Cryptography + API in modern browsers) or crypto.randomBytes (Node.js), otherwise, if the the + value of the property is false the return value is generated by Math.random (fastest).

+

To make the crypto object available globally in Node.js use

+
global.crypto = require('crypto')

If the value of this Decimal constructor's crypto property is set true and the @@ -698,7 +700,6 @@ Decimal.random() // '0.4117936847' Decimal.random(20) // '0.78193327636914089009' -

round.round(x) ⇒ Decimal

x: number|string|Decimal

See round.

@@ -1102,7 +1103,11 @@ Decimal.modulo // 9 used.

See random.

-
Decimal.crypto                     // false
+    
+// Node.js
+global.crypto = require('crypto')
+
+Decimal.crypto                     // false
 Decimal.set({ crypto: true })
 Decimal.crypto                     // true
@@ -2631,8 +2636,8 @@ z = x.multiply(y) // 4.1400000