Syntax
crypt.generatebytes(length: integer): stringArguments
| Name | Type | Description |
|---|---|---|
length | integer | Number of bytes to generate. |
Returns
| Name | Type | Description |
|---|---|---|
bytes | string | Random byte string with the requested length. |
Description
Generates cryptographically secure random bytes with the requested length.
Call it with 1 parameter(s): length. The argument table explains which values are required and which ones only refine the behavior.
It returns bytes (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = crypt.generatebytes(1)
print(result)