getfunctionhash

Computes a function's bytecode fingerprint.

Syntax

Signature
getfunctionhash(Function: function) -> string

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
FunctionfunctionLuau closure to fingerprint.

Returns

TypeDescription
string64-character hexadecimal SHA-256 digest.

Notes

Returns a lowercase SHA-256 digest of the hexadecimal bytecode dump produced by debug.decompile. Function must be a Luau closure. This is a bytecode fingerprint and does not identify source text.

Example

Luau
local Result = getfunctionhash(function() return 42 end)
print(Result)