repositories
/
benchmarks-js.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa697b2
)
Reuse secureRandom
author
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 21 Sep 2021 12:44:34 +0000
(14:44 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 21 Sep 2021 12:44:34 +0000
(14:44 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
random.js
patch
|
blob
|
blame
|
history
diff --git
a/random.js
b/random.js
index 4b41596fd2b0ad3d1a6adaa818ec941135b48644..98b59ed34f5241db671aad996fecc51b58ecdb05 100644
(file)
--- a/
random.js
+++ b/
random.js
@@
-1,18
+1,10
@@
const Benchmark = require('benchmark')
-const crypto = require('crypto')
-const { LIST_FORMATTER } = require('./benchmark-utils')
+const { LIST_FORMATTER, secureRandom } = require('./benchmark-utils')
const suite = new Benchmark.Suite()
const maximum = 1000
-/**
- *
- */
-function secureRandom () {
- return crypto.randomBytes(4).readUInt32LE() / 0x100000000
-}
-
/**
* @param max
* @param min