See also: License (zlib)
Library is currently WIP! Will be updated frequently.
A simple to use, fast and modern C++20 Hash library which supports hardware accelerated algorithms (SIMD intrinsics) for x86 and ARMv8 (like AppleSilicon). See Performance and Benchmarks for speeds. The static library provides very easy integration in your projects and ultra high speeds for the most common hash algorithms like MD5, MD6, SHA0, SHA1, SHA2 (SHA224, SHA256, SHA384, SHA512), SHA3 (SHA3-224, SHA3-256, SHA3-384, SHA3-512), CRC16, CRC32, CRC64, CRC128 and others. See Supported hash algorithms for details. CMake build environment is supported, as well as generating projects for VisualStudio or Xcode.
TODO WRITE: STREAMING FOR LARGE FILES
Algorithm | Supported | Hardware acceleration (SIMD) |
---|---|---|
CRC16 | ✅ Yes | ❌ ARM | ❌ x86 |
CRC32 | ✅ Yes | ✅ ARM | ❌ x86 |
CRC64 (ECMA) | ✅ Yes | ❌ ARM | ❌ x86 |
Algorithm | Supported | Hardware acceleration (SIMD) |
---|---|---|
MD5 | ✅ Yes | ❌ ARM | ❌ x86 |
MD6 | ❌ WIP | ❌ ARM | ❌ x86 |
Algorithm | Supported | Hardware acceleration (SIMD) |
---|---|---|
SHA1 | ❌ WIP | ❌ ARM | ❌ x86 |
SHA224 | ✅ Yes | ✅ ARM | |
SHA256 | ✅ Yes | ✅ ARM | |
SHA384 | ✅ Yes | ✅ ARM | ❌ x86 |
SHA512 | ✅ Yes | ✅ ARM | ❌ x86 |
SHA512/224 | ❌ WIP | ❌ ARM | ❌ x86 |
SHA512/256 | ❌ WIP | ❌ ARM | ❌ x86 |
SHA3-512 | ❌ WIP | ❌ ARM | ❌ x86 |
Algorithm | Supported | Hardware acceleration |
---|---|---|
Base64 | ❌ WIP | ❌ ARM | ❌ x86 |
Apple Clang, Release build, -O3 optimization
Algorithm | Speed (MB/s) |
---|---|
CRC16 Software | 375.54 MB/s |
CRC16 Hardware (SIMD) | xxx MB/s |
CRC32 Software | 376.49 MB/s |
CRC32 Hardware (SIMD) | 8031.77 MB/s |
CRC64 Software | 378.56 MB/s |
CRC64 Hardware (SIMD) | xxx MB/s |
Algorithm | Speed (MB/s) |
---|---|
MD5 Software | 538.12 MB/s |
MD5 Hardware (SIMD) | xxx MB/s |
Algorithm | Speed (MB/s) |
---|---|
SHA224 Software | 218.50 MB/s |
SHA224 Hardware (SIMD) | 1944.76 MB/s |
SHA256 Software | 217.76 MB/s |
SHA256 Hardware (SIMD) | 1944.79 MB/s |
SHA384 Software | 317.07 MB/s |
SHA384 Hardware (SIMD) | xxx MB/s |
SHA512 Software | 317.10 MB/s |
SHA512 Hardware (SIMD) | 1337.49 MB/s |
TODO
To download the library simply clone the repository:
git clone https://github.com/LostInCompilation/HashMe
Compilation of the library and examples can be done using CMake and make. Additionally projects for VisualStudio and Xcode can be generated. Small Shell scripts for compiling and generating projects are included.
TODO
TODO
TODO
Include the main header file of the library in your project:
#include "HashMe.hpp"
LINKING
If you prefer, directly use the namespace for the library:
using namespace HashMe;
A shorter namespace alias HM
is also available:
using namespace HM;
TODO
TODO
TODO