userver: userver/crypto/hash.hpp File Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
hash.hpp File Reference

Detailed Description

Cryptographic hashing.

Definition in file hash.hpp.

Go to the source code of this file.

#include <string_view>
+ This graph shows which files directly or indirectly include 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 on encoding param.
 
std::string crypto::hash::Sha1 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-1, output format depends on encoding param.
 
std::string crypto::hash::Sha224 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-224, output format depends on encoding param.
 
std::string crypto::hash::Sha256 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-256, output format depends on encoding param.
 
std::string crypto::hash::Sha384 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-384, output format depends on encoding param.
 
std::string crypto::hash::Sha512 (std::string_view data, OutputEncoding encoding=OutputEncoding::kHex)
 Calculates SHA-512, output format depends on 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 on encoding param.