size random bytes.
crypt.generatebytes; for an AES key use crypt.generatekey.
Most commonly used as a raw-randomness source for tokens, salts, and nonces.
Parameters
Returns
string - size random bytes.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
size random bytes.
crypt.random(size: number): string
crypt.generatebytes; for an AES key use crypt.generatekey.
Most commonly used as a raw-randomness source for tokens, salts, and nonces.
| Parameter | Type | Description |
|---|---|---|
size | number | Number of random bytes to return. |
string - size random bytes.
local random = crypt.random(10)
local token = crypt.random(16)
print(#token) --> 16