Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/bytecodealliance/ComponentizeJS
/ getRandomBytes
Function
getRandomBytes
test/cases/wall-clock/random-t.js:3–5 ·
view source on GitHub ↗
(len)
Source
from the content-addressed store, hash-verified
1
import
{ randomBytes } from
"node:crypto"
;
2
3
export
function
getRandomBytes(len) {
4
return
randomBytes(Number(len));
5
}
6
7
export
function
getRandomU64 () {
8
return
new
BigUint64Array(randomBytes(8).buffer)[0];
Callers
1
run
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected