For the latest stable version, please use Botan 1.1! |
botan.hash_function
local hash_function = require "botan".hash_function
Functions
create(algo_spec: string[, provider: string]) → hash_function|nil
Return a newly allocated hash function object, or nil
if algo_spec
is not
recognized.
create_or_throw(algo_spec: string[, provider: string]) → hash_function
Like create
except that it will throw an exception instead of returning nil
.
providers(algo_spec: string) → string[]
Returns the list of available providers for this algorithm, empty if not available.
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.
process(self, input: byte_span|string) → secure_byte_span
Equivalent to calling update
followed by final
.
new_object(self) → hash_function
Return a newly allocated HashFunction object of the same type as this one.