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.
Luau
getscripthash(script: ScriptInstance) -> string?Parameters
| Parameter | Type | Description |
|---|---|---|
script | ScriptInstance | Script 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
Luau
local candidate = getscripts()[1]
if candidate then
print("Bytecode hash:", getscripthash(candidate) or "unavailable")
end