Yuari
Documentation
Docs/Crypt/crypt.generatebytes

crypt.generatebytes

Random bytes or key.

Syntax

crypt.generatebytes(size: any) -> string

Parameters

ParameterTypeDescription
sizeanyThe size of the object or buffer.

Returns

TypeDescription
stringThe 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.