crypt.hash
Computes a hash digest.
Syntax
Signature
crypt.hash(Data: string, Algorithm: string?) -> stringAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Data | string | Bytes to hash, up to 16 MiB. |
Algorithm | string? | Hash algorithm. Defaults to sha256. |
Returns
| Type | Description |
|---|---|
string | Lowercase hexadecimal digest. |
Notes
Algorithm defaults to sha256. Supported names are md5, sha1, sha256, sha384, sha512, sha3-256, sha3-384, and sha3-512. The platform provider can reject an unavailable algorithm.
Example
Luau
local Result = crypt.hash("hello")
print(Result)