---
title: "getfunctionhash"
description: "Hashes a Luau function's prototype-derived representation using SHA384."
---

```lua
getfunctionhash(fn: function): string
```

---

## Aliases

None.

---

## Arguments

<ParamField body="fn" type="function" required>
  The function to inspect or wrap.
</ParamField>

---

## Returns

<ResponseField name="hash" type="string">
  The function's prototype-derived SHA384 digest.
</ResponseField>

C closures raise. Crypt registers after Closures and replaces the earlier global implementation. This is not a hash of source text and is not a stable cross-build identifier.

---

## Example

```lua
local function sample() return "hello" end
print(getfunctionhash(sample))
```
