---
name: "hash"
section: "3lua"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/hash/3lua"
---

# hash(3lua)

Lua Cryptographic hash module.

## NAME

**new**, **update**, **digest**, **hexdigest** – Lua Cryptographic hash module.

## DESCRIPTION

The built-in cryptographic hashing Lua bindings for the are available via the **hash** table.

### Supported Hashing Schemes

The following hashing schemes are supported by the hash module.

- sha256

### APIs Supported

- **new**(*data*)

  Compute a digest based on the *data*.

- **update**(*Va*, *data*)

  Using the current digest, process *data* to compute a new digest as if all prior data had been concatenated together.

- **digest**()

  Return the hashed digest as a binary array. This resets the context.

- **hexdigest**()

  Take **digest**() and convert it to an upper case hex string. This resets the context.

- *digest\_size*

  Return the size of the digest, in bytes.

- *block\_size*

  Return the block size used in bytes.

## EXAMPLES

## SEE ALSO

[sha256(3)](/sha256/3.md)

## AUTHORS

The **new** man page was written by Warner Losh ⟨*imp@FreeBSD.org*⟩.
