---
title: "crypt.hash"
description: "Returns a hexadecimal digest."
---

```lua
crypt.hash(data: string, algorithm: string? = "sha384"): string
```

---

## Aliases

None.

---

## Arguments

<ParamField body="data" type="string" required>
  The input bytes as a binary-safe Luau string.
</ParamField>

<ParamField body="algorithm" type="string" default={"\"sha384\""}>
  The digest algorithm name. See the supported values under Returns.
</ParamField>

---

## Returns

<ResponseField name="digest" type="string">
  The hexadecimal digest of the input bytes.
</ResponseField>

Supported case-insensitive algorithms: md5, sha1, sha224, sha256, sha384, sha512, sha3-224, sha3-256, sha3-384, sha3-512; SHA3 underscores are also accepted. Unsupported names raise.

---

## Example

```lua
print(crypt.hash("hello", "sha256"))
```
