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.
Luau
getfunctionhash(value: Function) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
value | Function | A Luau function; C closures do not have a supported prototype hash. |
Returns
stringA 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
Luau
local function compute(value)
return value * 2
end
print(getfunctionhash(compute))