From 3cbfd6da0840065c4cebaf26f3edd55a1137b33a Mon Sep 17 00:00:00 2001
From: Michael Mclaughlin
If the value of To make the
If the value of See 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).
crypto
object available globally in Node.js useglobal.crypto = require('crypto')
this
Decimal constructor's
crypto
property is set true
and the
@@ -693,7 +695,6 @@ Decimal.random() // '0.4117936847'
Decimal.random(20) // '0.78193327636914089009'
-
round
.round(x) ⇒ Decimal
x
: number|string|Decimalround
.
See random
.
Decimal.crypto // false ++// Node.js +global.crypto = require('crypto') + +Decimal.crypto // false Decimal.set({ crypto: true }) Decimal.crypto // true