HASH(3lua)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… HASH(3lua) β€” like, the Lua cryptographic hash module, bestie

okay so this is a page from the LOCAL manual, and it's about the hash module. Sit down, hydrate, and let's get into it πŸ’–


✨ NAME ✨

new, update, digest, hexdigest β€” the Lua Cryptographic hash module, bestie. That's the whole vibe check.


🌸 DESCRIPTION 🌸

The built-in cryptographic hashing Lua bindings β€” for the… yeah, the original sentence literally just trails off there, no cap, the word is missing β€” are available via the hash table. 🫢

πŸŽ€ Supported Hashing Schemes πŸŽ€

The following hashing schemes are supported by the hash module, and here's the full list (it's short, she's lowkey minimal):

  • sha256

πŸ¦‹ APIs Supported πŸ¦‹

These are the functions and fields you get, okurrr:

  • new(data) β€” computes a digest based on the data. Fresh start energy.
  • update() data β€” takes the current digest and processes data to compute a new digest, as if all the prior data had been concatenated together. It's giving "and another one" πŸ’…
  • digest() β€” returns the hashed digest as a binary array. Heads up: this resets the context. 😭
  • hexdigest() β€” takes digest() and converts it to an upper case hex string. Also resets the context, so don't say I didn't warn you 🫢
  • digest_size β€” returns the size of the digest, in bytes.
  • block_size β€” returns the block size used, in bytes.
not the "this resets the context" jump scare twice in a row πŸ’€ note it, remember it, live by it.

⭐ EXAMPLES ⭐

bestie… there are literally no examples here. The section exists, the section is empty, and honestly? She said "figure it out" and left. Iconic. πŸ™ˆ


🌈 SEE ALSO 🌈

  • sha256(3) β€” go read that one too, iykyk.

πŸ‘‘ AUTHORS πŸ‘‘

The new man page was written by Warner Losh <imp@FreeBSD.org>. Shoutout to Warner, main character of documentation 🫢✨


and that's the whole page, bestie β€” no crumbs left behind πŸ“

sign-off szn: this gorgeous thing came from Debian, dated February 6, 2024, and it's page HASH(3lua) from the LOCAL manual. mwah πŸ’‹

πŸ“¦ where this page comes from