crypt.generatebytes
Generates Base64-encoded random bytes.
Syntax
Signature
crypt.generatebytes(Count: number) -> stringAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Count | number | Number of random bytes before Base64 encoding. |
Returns
| Type | Description |
|---|---|
string | Base64 text containing the random bytes. |
Notes
Count is the number of raw bytes before encoding and must be an integer from zero through 16 MiB.
Example
Luau
local Result = crypt.generatebytes(16)
print(Result)