Random Bytes
A block of cryptographically random bytes as hex, base64 or base64url. Never falls back to Math.random().
Random Bytes fills Length bytes from the platform's cryptographic random source (crypto.getRandomValues) and renders them in Encoding. If there is no such source it fails loudly rather than substituting Math.random() — a silent downgrade there produces output that looks identical and is worthless. Length counts BYTES, not characters: 32 bytes is 64 hex characters or 43 base64url characters. A length outside 1-4096 is refused rather than clamped.
When to use it
A nonce, a CSRF token, a PKCE verifier, an invite code, a one-time download key — anything that has to be unguessable. For an identifier that only has to be unique, the UUID node says so more clearly.
At a glance
| Category | Utilities |
| Type name | net.noodl.RandomBytes |
| Available in | browser, cloud |
| SSR compatibility | safe |
| Provided by | noodl-runtime |