repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
970b38d
)
fix: workaround node 16 issue with crypto named export
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Fri, 25 Aug 2023 17:45:01 +0000
(19:45 +0200)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Fri, 25 Aug 2023 17:45:01 +0000
(19:45 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/utils.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils.ts
b/src/utils.ts
index 6178d8f116988475eca3e3fc8ac96a9260c563b7..33ec019db92c46688615be01bd8a59573c0b2457 100644
(file)
--- a/
src/utils.ts
+++ b/
src/utils.ts
@@
-1,5
+1,5
@@
import * as os from 'node:os'
-import
{ getRandomValues }
from 'node:crypto'
+import
* as crypto
from 'node:crypto'
import type {
MeasurementStatisticsRequirements,
WorkerChoiceStrategyOptions
@@
-254,5
+254,5
@@
export const once = (
* @returns A number in the [0,1[ range
*/
export const secureRandom = (): number => {
- return getRandomValues(new Uint32Array(1))[0] / 0x100000000
+ return
crypto.
getRandomValues(new Uint32Array(1))[0] / 0x100000000
}