syn. crypt. hash Synchronous
syn.crypto.hash
Compute a SHA-384 digest of a byte string. Use it when a file fingerprint specifically requires SHA-384. The fixed algorithm makes this different from crypt.hash, which takes an algorithm argument.
Luau
syn.crypt.hash(data: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
data | string | Bytes to hash. |
Returns
stringThe digest as lowercase hexadecimal text.
Usage notes
The algorithm is fixed to SHA-384. Use syn.crypt.custom.hash to choose another supported algorithm.
Availability
This function requires the Synapse environment setting, which is off by default.
Example
Luau
-- Enable the Synapse environment setting first.
local digest = syn.crypt.hash("example contents")
print(digest)
print(#digest) -- 96 hexadecimal characters