Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121929316
rng.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 14, 22:04
Size
323 B
Mime Type
text/x-java
Expires
Wed, Jul 16, 22:04 (2 d)
Engine
blob
Format
Raw Data
Handle
27414681
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
rng.js
View Options
import
crypto
from
'crypto'
;
const
rnds8Pool
=
new
Uint8Array
(
256
);
// # of random values to pre-allocate
let
poolPtr
=
rnds8Pool
.
length
;
export
default
function
rng
()
{
if
(
poolPtr
>
rnds8Pool
.
length
-
16
)
{
crypto
.
randomFillSync
(
rnds8Pool
);
poolPtr
=
0
;
}
return
rnds8Pool
.
slice
(
poolPtr
,
poolPtr
+=
16
);
}
Event Timeline
Log In to Comment