xref: /freebsd/libexec/flua/libhash/hash.3lua (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1.\"
2.\" Copyright (c) 2024 Netflix, Inc.
3.\"
4.\" SPDX-License-Identifier: BSD-2-Clause
5.\"
6.Dd February 6, 2024
7.Dt HASH 3lua
8.Os
9.Sh NAME
10.Nm new ,
11.Nm update ,
12.Nm digest ,
13.Nm hexdigest
14.Nd Lua Cryptographic hash module.
15.Sh DESCRIPTION
16The built-in cryptographic hashing Lua bindings for the are available via the
17.Ic hash
18table.
19.Ss Supported Hashing Schemes
20The following hashing schemes are supported by the hash module.
21.Bl -bullet -compact
22.It
23sha256
24.El
25.Ss APIs Supported
26.Bl -tag -width asdf -compact
27.It Fn new data
28Compute a digest based on the
29.Va data .
30.It Fn update Va data
31Using the current digest, process
32.Va data
33to compute a new digest as if all prior data had been concatenated together.
34.It Fn digest
35Return the hashed digest as a binary array.
36This resets the context.
37.It Fn hexdigest
38Take
39.Fn digest
40and convert it to an upper case hex string.
41This resets the context.
42.It Va digest_size
43Return the size of the digest, in bytes.
44.It Va block_size
45Return the block size used in bytes.
46.El
47.Sh EXAMPLES
48.Sh SEE ALSO
49.Xr sha256 3
50.Sh AUTHORS
51The
52.Nm
53man page was written by
54.An Warner Losh Aq Mt imp@FreeBSD.org .
55