Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101043869
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
Wed, Feb 5, 03:40
Size
546 B
Mime Type
text/x-java
Expires
Fri, Feb 7, 03:40 (2 d)
Engine
blob
Format
Raw Data
Handle
24081220
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