HashPlusPlus
HashPlusPlus copied to clipboard
A C++17 header-only library to easily retrieve hashes/HMACs from data, files, and files in nested directories through a simple interface.
Purpose
Hash++ is a C++17 header-only library that allows a user to retrieve multiple types of hashes from data, files, and files in nested directories. The original purpose behind this library was to create a header-file only implementation of multiple different hash algorithms. You can find a list of the currently supported hash algorithms below.Supported Algorithms
| Algorithm | HMAC Support? |
|---|---|
| MD5 | :heavy_check_mark: |
| MD4 | :heavy_check_mark: |
| MD2 | :heavy_check_mark: |
| SHA1 | :heavy_check_mark: |
| SHA2-224 | :heavy_check_mark: |
| SHA2-256 | :heavy_check_mark: |
| SHA2-384 | :heavy_check_mark: |
| SHA2-512 | :heavy_check_mark: |
| SHA2-512/224 | :heavy_check_mark: |
| SHA2-512/256 | :heavy_check_mark: |
| SHA-3 | In Progress |
Hash++ also aims to be a suitable alternative to heavier, statically and dynamically-linked libraries such as OpenSSL and Crypto++. I created it keeping in mind the mindset of a programmer who simply wants a header-only file that lets them easily and comfortably "just hash sh*t." Does it really have to be that difficult?
No, it doesn't.
Quick Example
Below you can find a minimal example of how to calculate the SHA2-256 hash of the dataHello World! using Hash++.
#include "hashpp.h"
using namespace hashpp;
int main() {
std::cout << get::getHash(ALGORITHMS::SHA2_256, "Hello World!") << std::endl;
// output:
// 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
}
You can find further detailed documentation in the /documentation directory.
Algorithm Metrics
Below you can view benchmarks of Hash++ computing 10 million hashes for each algorithm. Each benchmark is based on the hashing of four concatenations of the lower and uppercase alphabet, plus base ten digits.- Intel Benchmarks
- Ryzen 9 5900HX Benchmark