> ## 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

> Roblox script object의 stored bytecode string에 대한 uppercase SHA384 hex digest를 반환합니다. argument는 object여야 합니다. 공유 bytecode reader는 ClassName 값 ModuleScript, LocalScript, CoreScript, Script를 허용합니다. Script의 경우 RunContext가 Client여야 합니다. ClassName이 없으면 function은 "Invalid Instance"를 발생시킵니다. ClassName이 지원되는 script classes 중 하나가 아니면 "Script expected"를 발생시킵니다. 값이 다른 RunContext의 Script이면 "Expected a Script with RunContext set to Client"를 발생시킵니다. embedded bytecode reference가 유효하지 않거나 stored bytecode 길이가 8 bytes 이하이면 function은 nil을 반환합니다. 그렇지 않으면 정확한 stored bytecode bytes를 SHA384로 hash하고 uppercase hex string을 반환합니다. function은 DecompressBytecode를 호출하지 않으며 decompressed bytecode를 hash하지 않습니다.

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

  ## 인수

  <ParamField path={"script"} type={"userdata"} required>
    Hash할 Script object입니다. 지원되는 ClassName 값은 ModuleScript, LocalScript, CoreScript, RunContext Client의 Script입니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"hash"} type={"string | nil"}>
    stored bytecode bytes의 uppercase SHA384 hex digest 또는 사용 가능한 embedded bytecode가 없을 때 nil입니다.
  </ResponseField>

  ## 예제

  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>
