userver: userver/crypto/hash.hpp File Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
hash.hpp File Reference

Cryptographic hashing. More...

#include <string_view>
+ Include dependency graph for hash.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  crypto
 Cryptography support.
 
namespace  crypto::hash
 Cryptographic hashing.
 
namespace  crypto::hash::weak
 Broken cryptographic hashes, must not be used except for compatibility.
 

Enumerations

enum class  OutputEncoding {
  kBinary ,
  kBase16 ,
  kHex = kBase16 ,
  kBase64
}
 
enum class  Pad {
  kWith ,
  kWithout
}
 

Functions

std::string crypto::hash::Blake2b128 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates Blake2-128, output format depends from encoding param.
 
std::string crypto::hash::Sha1 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-1, output format depends from encoding param.
 
std::string crypto::hash::Sha224 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-224, output format depends from encoding param.
 
std::string crypto::hash::Sha256 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-256, output format depends from encoding param.
 
std::string crypto::hash::Sha384 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-384, output format depends from encoding param.
 
std::string crypto::hash::Sha512 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-512, output format depends from encoding param.
 
std::string crypto::hash::HmacSha1 (std::string_view key, std::string_view message, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates HMAC (using SHA-1 hash), encodes result with encoding algorithm.
 
std::string crypto::hash::HmacSha256 (std::string_view key, std::string_view message, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates HMAC (using SHA-256 hash), encodes result with encoding algorithm.
 
std::string crypto::hash::HmacSha384 (std::string_view key, std::string_view message, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates HMAC (using SHA-384 hash), encodes result with encoding algorithm.
 
std::string crypto::hash::HmacSha512 (std::string_view key, std::string_view message, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates HMAC (using SHA-512 hash), encodes result with encoding algorithm.
 
std::string crypto::hash::weak::Md5 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates MD5, output format depends from encoding param.
 

Detailed Description

Cryptographic hashing.

Definition in file hash.hpp.