CryptoSys PKI
23.0.0
|
Message digest hash functions. More...
Public Types | |
enum class | Alg |
Hash algorithm More... | |
enum class | FileMode |
File mode. More... | |
Static Public Member Functions | |
static std::string | AlgName (Hash::Alg alg) |
Get the algorithm name. More... | |
static bvec_t | Bytes (const bvec_t &data, Alg alg=Alg::Sha1) |
Compute hash digest over byte array. More... | |
static bvec_t | Double (const bvec_t &data, Alg alg=Alg::Sha1) |
Create double hash (hash of hash). More... | |
static bvec_t | File (const std::string &fileName, Alg alg=Alg::Sha1, FileMode mode=FileMode::Binary) |
Compute hash digest over a binary file. More... | |
static Hash::Alg | HashAlgFromString (const std::string &hashStr) |
Get hash algorithm from a string. More... | |
static std::string | HexFromBytes (const bvec_t &data, Alg alg=Alg::Sha1) |
Compute hash digest in hex format over byte array. More... | |
static std::string | HexFromFile (const std::string &fileName, Alg alg=Alg::Sha1, FileMode mode=FileMode::Binary) |
Compute hash digest in hex format over a file. More... | |
static std::string | HexFromHex (const std::string &dataHex, Alg alg=Alg::Sha1) |
Compute hash digest in hex format over hex-encoded input. More... | |
static std::string | HexFromString (const std::string &s, Alg alg=Alg::Sha1) |
Compute hash digest in hex format over string input. More... | |
static int | Length (Alg alg) |
Return length of message digest output in bytes. More... | |
Message digest hash functions.
|
strong |
Hash algorithm
|
strong |
|
static |
Get the algorithm name.
alg | Hash algorithm |
"sha512"
. Compute hash digest over byte array.
data | Message data in byte array |
alg | Digest algorithm to be used (default = SHA-1) |
Create double hash (hash of hash).
data | Message data in byte array |
alg | Digest algorithm to be used (default = SHA-1) |
HASH(HASH(m))
in byte array.
|
static |
Compute hash digest over a binary file.
fileName | Name of file containing message data |
alg | Digest algorithm to be used (default = SHA-1) |
mode | File mode (default = binary) |
|
static |
Get hash algorithm from a string.
hashStr | String containing name of hash algorithm, e.g. "sha1" or "SHA-1" . |
Compute hash digest in hex format over byte array.
data | Message data in byte array |
alg | Digest algorithm to be used (default = SHA-1) |
|
static |
Compute hash digest in hex format over a file.
fileName | Name of file containing message data |
alg | Digest algorithm to be used (default = SHA-1) |
mode | File mode (default = binary) |
|
static |
Compute hash digest in hex format over hex-encoded input.
dataHex | Message data in hex-encoded format |
alg | Digest algorithm to be used (default = SHA-1) |
Compute hash digest in hex format over string input.
s | Message data string |
alg | Digest algorithm to be used (default = SHA-1) |
|
static |
Return length of message digest output in bytes.
alg | Digest algorithm. |