> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getscripthash

> Retorna um uppercase SHA384 hex digest para o stored bytecode string de um Roblox script object. O argument deve ser object. O helper compartilhado GetBytecode aceita valores ClassName ModuleScript, LocalScript, CoreScript e Script. Para Script, RunContext deve ser Client. Se ClassName estiver ausente, a function gera "Invalid Instance". Se ClassName nao for uma das script classes suportadas, gera "Script expected". Se o valor for um Script com outro RunContext, gera "Expected a Script with RunContext set to Client". Se o embedded bytecode reference for invalido ou o comprimento de stored bytecode for 8 bytes ou menos, a function retorna nil. Caso contrario, calcula SHA384 dos stored bytecode bytes exatos e retorna o uppercase hex string. A function nao chama DecompressBytecode e nao calcula hash de decompressed bytecode.

<div className="real-function-page">
  ```lua theme={null}
  getscripthash(script: userdata): string | nil
  ```

  ## Argumentos

  <ParamField path={"script"} type={"userdata"} required>
    Script object para calcular hash. Os valores ClassName suportados sao ModuleScript, LocalScript, CoreScript e Script com RunContext Client.
  </ParamField>

  ## Retornos

  <ResponseField name={"hash"} type={"string | nil"}>
    Uppercase SHA384 hex digest dos stored bytecode bytes, ou nil quando nao ha embedded bytecode utilizavel.
  </ResponseField>

  ## Exemplo

  Hash the bytecode of a supported Roblox script Instance when bytecode is available.

  ```lua theme={null}
  local targetScript

  for _, descendant in ipairs(game:GetDescendants()) do
      if descendant:IsA("LuaSourceContainer") then
          targetScript = descendant
          break
      end
  end

  if targetScript then
      local hash = getscripthash(targetScript)
      print(hash)
  end
  ```
</div>
