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.

Syntax
Luau
syn.crypt.hash(data: string) -> string

Parameters

Function parameters
ParameterTypeDescription
datastringBytes to hash.

Returns

string

The 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

Example
Luau
-- Enable the Synapse environment setting first.
local digest = syn.crypt.hash("example contents")
print(digest)
print(#digest) -- 96 hexadecimal characters
Kawaii documentation