crypt.generatebytes

Generates Base64-encoded random bytes.

Syntax

Signature
crypt.generatebytes(Count: number) -> string

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
CountnumberNumber of random bytes before Base64 encoding.

Returns

TypeDescription
stringBase64 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)