This repository includes a wrapper around OpenSSL's hash functions (which typically have a very complex API and less-than-extensive documentation).
We provide the following function:
// Arguments:
// * input: std::string representing the
// plaintext you would like to hash
// * input_len: length of input (in bytes)
// Output:
// * std::string representing the hash of the input plaintext
std::string hash_str(std::string input, int input_len)
This function consumes an std::string
as well as its length and returns an std::string
that is the hash of the string given. Hash functions have the property that hashing the same string twice will give you the same hash, but it's very difficult to go from the hash back to the original string. This is what makes them so secure!