BOTAN(3em)

πŸ“¦ version 1.2.1, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

Okay bestie, welcome to BOTAN(3em) β€” this is the manual page for botan, aka the Botan bindings for Emilua. It’s giving β€œI know my hash functions and I’m gonna make it cute” πŸ’…βœ¨


✨ SYNOPSIS ✨

local hash_function = require "botan".hash_function

🫢 FUNCTIONS 🫢

create(algo_spec: string[, provider: string]) β†’ hash_function|nil

Returns a newly allocated hash function object, or nil if algo_spec is not recognized. The optional provider: string is right there in the signature too, bestie πŸ¦‹

create_or_throw(algo_spec: string[, provider: string]) β†’ hash_function

Like create, except that it will throw an exception instead of returning nil. So if you want drama when it fails, this is your girl 😭πŸ”₯

providers(algo_spec: string) β†’ string[]

Returns the list of available providers for this algorithm, empty if not available. Literally an empty list if it’s not available β€” no cap 🌸

update(self, input: byte_span|string)

Updates the computation with input. Feed it the data, bestie πŸ’–

final(self)

function final(self, out: byte_span)     (1)
function final(self) -> secure_byte_span (2)
  1. Place the result into out. Exactly output_length bytes will be written.
  2. Returns the result in a newly allocated secure_byte_span.

Finalize the calculation. After you call final, the algorithm is reset to its initial state, so it may be reused immediately. Reusable queen behavior πŸ‘‘βœ¨

process(self, input: byte_span|string) β†’ secure_byte_span

Equivalent to calling update followed by final. One-stop shop, no extra steps πŸŽ€

new_object(self) β†’ hash_function

Return a newly allocated HashFunction object of the same type as this one.

copy_state(self) β†’ hash_function

Return a newly allocated HashFunction object of the same type as this one, whose internal state matches the current state of this. It’s giving clone-but-make-it-accurate πŸ’…

clear(self)

Reset the state. Clean slate, fresh vibe, periodt 🌈


πŸ’– PROPERTIES πŸ’–

  • output_length: integer β€” The size (in bytes) of the output of this function.
  • name: string β€” The hash function name.
  • provider: string β€” Provider information about this implementation. Default is "base", might also return "sse2", "avx2", "openssl", or some other arbitrary string.
  • hash_block_size: integer β€” Hash block size as defined for this algorithm.

And that’s the whole iconic page, bestie πŸ’‹ β€” it comes from Emilua 0.12.1, dated 1980-01-01, and it’s the BOTAN(3em) manual. Bye fr fr πŸŽ€βœ¨

πŸ“¦ where this page comes from