{"id":31729860,"url":"https://github.com/ron4fun/hashlibplus","last_synced_at":"2025-10-09T07:18:13.448Z","repository":{"id":144160156,"uuid":"389600183","full_name":"ron4fun/HashLibPlus","owner":"ron4fun","description":"HashLibPlus is a recommended C++11 hashing library that provides a fluent interface for computing hashes and checksums of strings, files, streams, bytearrays and untyped data to mention but a few.","archived":false,"fork":false,"pushed_at":"2024-03-28T21:27:54.000Z","size":1391,"stargazers_count":26,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-23T05:36:02.293Z","etag":null,"topics":["argon2","blake-algorithms","cpp","crc-algorithms","crypto","cryptography","gost","hash","hmac","keccak","md5","murmurhash","pbkdf2","scrypt","sha-hashes","siphash","snefru","tiger","whirlpool","xof"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ron4fun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-26T10:52:04.000Z","updated_at":"2024-07-02T22:00:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f72539dd-be78-4517-8d7a-ae6d84b33a18","html_url":"https://github.com/ron4fun/HashLibPlus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ron4fun/HashLibPlus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2FHashLibPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2FHashLibPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2FHashLibPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2FHashLibPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ron4fun","download_url":"https://codeload.github.com/ron4fun/HashLibPlus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2FHashLibPlus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000985,"owners_count":26082972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argon2","blake-algorithms","cpp","crc-algorithms","crypto","cryptography","gost","hash","hmac","keccak","md5","murmurhash","pbkdf2","scrypt","sha-hashes","siphash","snefru","tiger","whirlpool","xof"],"created_at":"2025-10-09T07:18:11.672Z","updated_at":"2025-10-09T07:18:13.437Z","avatar_url":"https://github.com/ron4fun.png","language":"C++","readme":"HashLibPlus [![License](http://img.shields.io/badge/license-MPL2-blue.svg)](https://github.com/Ron4fun/HashLibPlus/blob/master/LICENSE)\n====\n\nHashLibPlus is a recommended C++11 hashing library that provides a fluent interface for computing hashes and checksums of strings, files, streams, bytearrays and untyped data to mention but a few.\n\nIt also supports **Incremental Hashing**, **Cloning**, **NullDigest**.\n\nAvailable Algorithms\n----------------------------------------\n\n ### Hashes\n----------------------------------------\n##### Cyclic Redundancy Checks\n\n* `All CRC Variants from CRC3 to CRC64` :heavy_check_mark:\n\n##### Checksums\n\n* `Adler32` :heavy_check_mark:\n\n##### Non-Cryptographic Hash Functions \n----------------------------------------\n\n###### 32 bit hashes\n\n* `AP` `BKDR` `Bernstein` `Bernstein1` `DEK` `DJB` `ELF` `FNV` :heavy_check_mark:\n\n* `FNV1a` `JS` `Jenkins3` `Murmur2` `MurmurHash3_x86_32` `OneAtTime` :heavy_check_mark:\n\n*  `PJW` `RS` `Rotating` `SDBM` `ShiftAndXor` `SuperFast` `XXHash32` :heavy_check_mark:\n\n###### 64 bit hashes\n\n* `FNV64` `FNV1a64` `Murmur2_64` `SipHash64_2_4` `XXHash64` :heavy_check_mark:\n\n###### 128 bit hashes\n\n* `MurmurHash3_x86_128` `MurmurHash3_x64_128` `SipHash128_2_4` :heavy_check_mark:\n\n##### Cryptographic Hash Functions \n----------------------------------------\n\n * `MD2` :heavy_check_mark:\n\n * `MD4` :heavy_check_mark:\n\n * `MD5` :heavy_check_mark:\n\n * `SHA-0` :heavy_check_mark:\n\n * `SHA-1` :heavy_check_mark:\n\n * `SHA-2 (224, 256, 384, 512, 512-224, 512-256)` :heavy_check_mark:\n\n * `GOST 34.11-94` :heavy_check_mark:\n\n * `GOST R 34.11-2012 (AKA Streebog) (256, 512)` :heavy_check_mark:\n \n * `Grindahl (256, 512)` :heavy_check_mark:\n \n * `HAS160` :heavy_check_mark:\n\n * `RIPEMD (128, 256, 256, 320)` :heavy_check_mark:\n\n * `Tiger (128, 160, 192 (Rounds 3, 4, 5))` :heavy_check_mark:\n\n * `Tiger2 (128, 160, 192 (Rounds 3, 4, 5))` :heavy_check_mark:\n \n * `Snefru (128, 256)` :heavy_check_mark:\n \n * `Haval (128, 160, 192, 224, 256 (Rounds 3, 4, 5))` :heavy_check_mark:\n \n * `Panama` :heavy_check_mark:\n \n * `RadioGatun (RadioGatun32, RadioGatun64)` :heavy_check_mark:\n\n * `WhirlPool` :heavy_check_mark:\n\n * `Blake2B (160, 256, 384, 512)` :heavy_check_mark:\n \n * `Blake2S (128, 160, 224, 256)` :heavy_check_mark:\n\n * `SHA-3 (224, 256, 384, 512)` :heavy_check_mark:\n \n * `Keccak (224, 256, 288, 384, 512)` :heavy_check_mark:\n \n * `Blake2BP` :heavy_check_mark:\n\n * `Blake2SP` :heavy_check_mark:\n\n * `Blake3` :heavy_check_mark:\n\n### Key Derivation Functions\n----------------------------------------\n\n###### Password Hashing Schemes (Password Based Key Derivation Functions)\n\n----------------------------------------\n\n* `PBKDF2` :heavy_check_mark:\n \n* `Argon2 (2i, 2d and 2id variants)` :heavy_check_mark:\n\n* `Scrypt` :heavy_check_mark:\n\n### MAC\n----------------------------------------\n\n* `HMAC (all supported hashes)` :heavy_check_mark:\n\n* `KMAC (KMAC128, KMAC256)` :heavy_check_mark:\n\n* `Blake2MAC (Blake2BMAC, Blake2SMAC)` :heavy_check_mark:\n\n### XOF (Extendable Output Function)\n----------------------------------------\n\n* `Shake (Shake-128, Shake-256)` :heavy_check_mark:\n\n* `CShake (CShake-128, CShake-256)` :heavy_check_mark:\n\n* `Blake2X (Blake2XS, Blake2XB)` :heavy_check_mark:\n\n* `KMACXOF (KMAC128XOF, KMAC256XOF)` :heavy_check_mark:\n\n* `Blake3XOF` :heavy_check_mark:\n\n### Usage Examples\n----------------------------------------\n\n\n```c++\n#include \"Base/HashFactory.h\"\n\nint main() \n{\n    IHash hash = HashFactory::Crypto::CreateMD5();\n\t\t\n    IHash clone = hash-\u003eClone();\n\n    IHMAC hmac = HashFactory::HMAC::CreateHMAC(hash);\n    hmac-\u003eSetKey(Converters::ConvertStringToBytes(\"password\"));\n\n    IHashResult Result1 = hash-\u003eComputeString(\"Hash\");\n    IHashResult Result2 = hmac-\u003eComputeString(\"Hash\");\n\t\n    bool check = Result1-\u003eCompareTo(Result2);\n    \n    return 0;\n}\n```\n\n\nFull Visual Studio project without CMake\n----------------------------------------\nPlease consider using this version [HashLibPlus-Reload](https://github.com/ron4fun/HashLibPlus-Reload) instead.\n\n\nHow to build library\n----------------------------------------\n### CMake\n----------------------------------------\nTo build this library you should have [CMake](https://cmake.org) installed and configured on your local machine to work with any *C++* compiler such as **gcc**, **g++** and **clang**. If you already have visual studio installed on your local machine, cmake kind of automatically links with the compiler and therefore builds a visual studio project of the library for you. `Visual Studio 2019` was used to build and compile this project. Goodluck! ;)\n\n*CMake version 2.30.3*, was specifically used to compile this library.\n\n**Note: [catch2](https://github.com/catchorg/Catch2) library was used as the test framework in the `HashLibPlus.Tests` project.** \n\nFollow the steps below to build for x86 (32-bit) Release mode.\n\n```\n\u003e cmake -G \"Visual Studio 16 2019\" -A Win32 -S {src_dir} -B {build_dir}\n```\n\n**Example:** `cmake -G \"Visual Studio 16 2019\" -A Win32 -S . -B x86`\n\nNote: The `.` used as the source directory indicates the current directory where the cmd interface is pointed to.\n\n```\n\u003e cmake --build {src_dir} --config Release\n```\n\nFollow the steps below to build for x64 (64-bit) Release mode.\n\n```\n\u003e cmake -G \"Visual Studio 16 2019\" -A x64 -S {src_dir} -B {build_dir}\n```\n\n**Example:** `cmake -G \"Visual Studio 16 2019\" -A x64 -S . -B x64`\n\nNote: The `.` used as the source directory indicates the current directory where the cmd interface is pointed to.\n\n```\n\u003e cmake --build {src_dir} --config Release\n```\n\nThis command is to build a `Visual Studio` project files of the library, where *{src_dir}* is the parent directory. And *{build_src}* is the build directory depending on \"x86\" or \"x64\".\n\n**Download the project full release [here](https://github.com/ron4fun/HashLibPlus/releases/tag/v1.0)**\n\nHow to run test\n----------------------------------------\n[catch2](https://github.com/catchorg/Catch2) is the test framework used in this project because of its flexible nature.\n\nTo run the unitests in *HashLibPlus.Tests* project, locate `HashLibPlus.Test.exe` in the Release folder of the built project.\n\n**The built project outputs two executables and a `hashplus.lib` for linking with the `Base/HashFactory.h` main header file.**\n\n* HashLibPlus.exe\n----------------------------------------\nThis executable displays a benchmark test analysis of the compiled code speed with regards to your C.P.U capability. \n\n* HashLibPlus.Test.exe\n----------------------------------------\nThis executable hooks into [catch2](https://github.com/catchorg/Catch2) process to allow for detailed test results, and other command line options that *catch2* supports for those that wish to pass values to *catch2* interface.\n\nMore on this library\n----------------------------------------\nDepending on how experienced you are with *CMake* or *catch2*, you are always free to make pull requests and most especially plug in your favourite *hash* into the library which might not be available now. Bye!\n\n### Other Implementations\n----------------------------------------\n\nIf you want implementations in other languages, you can check out these\n\n* [SharpHash](https://github.com/ron4fun/SharpHash) by Mbadiwe Nnaemeka Ronald\n* [HashLib4Pascal](https://github.com/Xor-el/HashLib4Pascal) by Ugochukwu Mmaduekwe\n\n### Tip Jar\n----------------------------------------\n\n* :dollar: **Bitcoin**: `1Mcci95WffSJnV6PsYG7KD1af1gDfUvLe6`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fron4fun%2Fhashlibplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fron4fun%2Fhashlibplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fron4fun%2Fhashlibplus/lists"}