getscripthash Synchronous

Get a digest of a script’s stored bytecode. It is useful for noticing that the bytecode changed without printing the binary content.

Syntax
Luau
getscripthash(script: ScriptInstance) -> string?

Parameters

Function parameters
ParameterTypeDescription
scriptScriptInstanceScript Instance whose stored bytecode will be hashed.

Returns

string?

A hash string, or nil when stored bytecode is unavailable.

Usage notes

A matching hash indicates matching stored bytes for this algorithm; it does not prove that two script Instances share the same runtime state.

Example

Example
Luau
local candidate = getscripts()[1]
if candidate then
    print("Bytecode hash:", getscripthash(candidate) or "unavailable")
end
Kawaii documentation