Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101485124
v4.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, 22:11
Size
546 B
Mime Type
text/x-java
Expires
Wed, Feb 12, 22:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24161074
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
v4.js
View Options
import rng from './rng.js';
import stringify from './stringify.js';
function v4(options, buf, offset) {
options = options || {};
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return stringify(rnds);
}
export default v4;
Event Timeline
Log In to Comment