Module hash

Source
Expand description

Specializes in Quantum-Resistant Cryptographic Hashing. Application hash functionality

Provides access to hash functions and types.

Modules§

algorithms
The algorithms module contains the password hashing algorithms.
hsh_macros
The macros module contains functions for generating macros.
loggers
The loggers module contains the loggers for the library.
macros
The macros module contains functions for generating macros.
models
The models module contains the data models for the library.

Macros§

generate_hash
This macro generates a new hash for a given password, salt, and algorithm.
hash_length
This macro returns the length of the password for a given Hash struct instance.
hsh
This macro takes any number of arguments and parses them into a Rust value. The parsed value is returned wrapped in hsh::Hash::parse() function call.
hsh_assert
This macro asserts that the given condition is true. If the condition is false, the macro panics with the message “Assertion failed!”.
hsh_contains
This macro checks if the given string contains the given substring.
hsh_in_range
This macro checks if the given value is within the given range. The range is inclusive of both endpoints.
hsh_join
This macro joins the given strings together with the given separator.
hsh_max
This macro finds the maximum value of the given values.
hsh_min
This macro finds the minimum value of the given values.
hsh_parse
This macro attempts to parse the given input into a u64 value. If parsing fails, an error is returned with a message indicating the failure.
hsh_print
This macro prints the given arguments to the console.
hsh_print_vec
This macro prints the given vector of values to the console. Each value is printed on a new line.
hsh_split
This macro splits the given string into a vector of strings. The string is split on whitespace characters.
hsh_vec
This macro creates a new vector with the given elements.
macro_execute_and_log
Macros related to executing shell commands.
macro_log_info
Custom logging macro for various log levels and formats.
match_algo
This macro matches the hash algorithm strings to their corresponding enum variants.
new_hash
This macro creates a new instance of the Hash struct with the given password, salt, and algorithm.
random_string
This macro generates a random string of the given length. The string consists of alphanumeric characters (both upper and lower case).
to_str_error
This macro abstracts away the error handling for the to_string method. If the method fails, an error is returned with the failure message.

Functions§

run
This is the main entry point for the Hash (HSH) library.