Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101465949
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, Feb 10, 17:51
Size
323 B
Mime Type
text/x-java
Expires
Wed, Feb 12, 17:51 (2 d)
Engine
blob
Format
Raw Data
Handle
24153801
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