Data_deduplication_service
Service that will use hashes to deduplicate files
hash_utils Namespace Reference

hash utils namespace More...

Enumerations

enum  hash_function {
  SHA_224 , SHA_256 , MD_5 , SHA_384 ,
  SHA_512 , MD_4
}
 

Functions

template<hash_function hash = MD_5>
std::string getHashStr (std::string_view stringView)
 
std::string stringToHex (std::string_view in)
 
std::string hexToString (std::string_view in)
 

Variables

constexpr std::array< unsigned char *(*)(const unsigned char *d, size_t n, unsigned char *md), 6 > funcs
 

Detailed Description

hash utils namespace

Enumeration Type Documentation

◆ hash_function

Enum for selected hash function

Enumerator
SHA_224 
SHA_256 
MD_5 
SHA_384 
SHA_512 
MD_4 

Function Documentation

◆ getHashStr()

template<hash_function hash = MD_5>
std::string hash_utils::getHashStr ( std::string_view  stringView)

Generates hash string with specified hash function

Template Parameters
hash
Parameters
stringView
+ Here is the caller graph for this function:

◆ hexToString()

std::string hash_utils::hexToString ( std::string_view  in)

Converts hexadecimal string to string

Parameters
in

◆ stringToHex()

std::string hash_utils::stringToHex ( std::string_view  in)

Converts string to hexadecimal string

Parameters
in

Variable Documentation

◆ funcs

constexpr std::array<unsigned char *(*)(const unsigned char *d, size_t n, unsigned char *md), 6> hash_utils::funcs
constexpr
Initial value:
= {&SHA224, &SHA256,
&MD5, &SHA384, &SHA512,&MD4}