Skip to content

A C++17 header-only library to easily retrieve hashes/HMACs from data, files, and files in nested directories through a simple interface.

License

Notifications You must be signed in to change notification settings

D7EAD/HashPlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


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 ✔️
MD4 ✔️
MD2 ✔️
SHA1 ✔️
SHA2-224 ✔️
SHA2-256 ✔️
SHA2-384 ✔️
SHA2-512 ✔️
SHA2-512/224 ✔️
SHA2-512/256 ✔️
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 data Hello 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.