crypt.generatebytes
Random bytes or key.
Syntax
crypt.generatebytes(size: any) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
size | any | The size of the object or buffer. |
Returns
| Type | Description |
|---|---|
string | The returned string. |
Description
crypt.generatebytes is part of the Crypt library. Crypt functions process data locally. Keys, hashes and encrypted buffers remain inside the process.
The operation is performed immediately using the arguments supplied at the call site.
The aliases crypt.generatekey(size?) resolve to the same implementation.
Example
print(#crypt.generatebytes(16), #crypt.generatekey(32))
Notes
- Aliases:
crypt.generatekey(size?). - Never log keys or decrypted buffers in production scripts.