getfunctionhash Synchronous

Compute a stable digest from a Luau function’s prototype. It is handy when comparing compiled code across separate closure instances without relying on their addresses.

Syntax
Luau
getfunctionhash(value: Function) -> string

Parameters

Function parameters
ParameterTypeDescription
valueFunctionA Luau function; C closures do not have a supported prototype hash.

Returns

string

A lowercase SHA-384 hexadecimal digest of serialized prototype content.

Usage notes

The hash describes compiled prototype content, not the current values of captured upvalues.

Example

Example
Luau
local function compute(value)
    return value * 2
end
print(getfunctionhash(compute))
Kawaii documentation