{"id":16906125,"url":"https://github.com/chocobo1/hash","last_synced_at":"2025-05-07T07:35:27.748Z","repository":{"id":49049713,"uuid":"102583679","full_name":"Chocobo1/Hash","owner":"Chocobo1","description":"C++14 header-only easy-to-use cryptographic hash library","archived":false,"fork":false,"pushed_at":"2024-05-19T20:06:29.000Z","size":716,"stargazers_count":61,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T07:41:41.574Z","etag":null,"topics":["cpp","crc32","hash","md5","sha2","sha3"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chocobo1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://myprojects.tzou.me/donation/"}},"created_at":"2017-09-06T08:30:38.000Z","updated_at":"2025-03-21T02:17:39.000Z","dependencies_parsed_at":"2024-05-19T18:44:48.295Z","dependency_job_id":"f2f1a623-de55-453d-b01b-06b3e12dce89","html_url":"https://github.com/Chocobo1/Hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FHash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FHash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FHash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FHash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chocobo1","download_url":"https://codeload.github.com/Chocobo1/Hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252834273,"owners_count":21811345,"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","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":["cpp","crc32","hash","md5","sha2","sha3"],"created_at":"2024-10-13T18:41:12.249Z","updated_at":"2025-05-07T07:35:27.727Z","avatar_url":"https://github.com/Chocobo1.png","language":"C++","funding_links":["https://myprojects.tzou.me/donation/"],"categories":[],"sub_categories":[],"readme":"# Hash [![AppVeyor_badge]][AppVeyor_link] [![GithubAction_badge]][GithubAction_link]\n\n[AppVeyor_badge]: https://ci.appveyor.com/api/projects/status/github/Chocobo1/Hash?branch=master\u0026svg=true\n[AppVeyor_link]: https://ci.appveyor.com/project/Chocobo1/Hash\n[GithubAction_badge]: https://github.com/Chocobo1/Hash/workflows/CI/badge.svg\n[GithubAction_link]: https://github.com/Chocobo1/Hash/actions\n\nC++14 header-only easy-to-use hash library\n\nWhat is included in this library:\n\n| Name                    | Variants                                 | Website                                                                                   |\n| ----------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------- |\n| BLAKE1                  | 224, 256, 384, 512                       | https://131002.net/blake/                                                                 |\n| BLAKE2                  | BLAKE2b, BLAKE2s                         | https://blake2.net/                                                                       |\n| CRC-32                  |                                          | http://create.stephan-brumme.com/crc32/                                                   |\n| Fowler–Noll–Vo (FNV)    | FNV32_0, FNV32_1, FNV32_1a               | http://www.isthe.com/chongo/tech/comp/fnv/index.html                                      |\n|                         | FNV64_0, FNV64_1, FNV64_1a               |                                                                                           |\n| HAS-160                 |                                          | https://www.tta.or.kr/eng/new/standardization/eng_ttastddesc.jsp?stdno=TTAS.KO-12.0011/R2 |\n| HAS-V (unfinished)      |                                          | https://link.springer.com/chapter/10.1007%2F3-540-44983-3_15                              |\n| MD2                     |                                          | https://tools.ietf.org/html/rfc1319                                                       |\n| MD4                     |                                          | https://tools.ietf.org/html/rfc1320                                                       |\n| MD5                     |                                          | https://tools.ietf.org/html/rfc1321                                                       |\n| RIPEMD                  | 128, 160, 256, 320                       | https://homes.esat.kuleuven.be/~bosselae/ripemd160.html                                   |\n| SipHash                 |                                          | https://github.com/veorq/SipHash                                                          |\n| SHA-1                   |                                          | https://tools.ietf.org/html/rfc3174                                                       |\n| SHA-2                   | 224, 256, 384, 512, 512-224, 512-256     | https://tools.ietf.org/html/rfc6234                                                       |\n| SHA-3                   | 224, 256, 384, 512, SHAKE-128, SHAKE-256 | https://keccak.team/index.html                                                            |\n| SHA-3 derived functions | CSHAKE-128, CSHAKE-256                   | http://csrc.nist.gov/groups/ST/hash/derived-functions.html                                |\n|                         | TupleHash-128, TupleHash-256             |                                                                                           |\n| SM3                     |                                          | https://tools.ietf.org/html/draft-sca-cfrg-sm3-02                                         |\n| Tiger                   | Tiger1-128, Tiger1-160, Tiger1-192       | https://www.cs.technion.ac.il/~biham/Reports/Tiger/                                       |\n|                         | Tiger2-128, Tiger2-160, Tiger2-192       |                                                                                           |\n| WHIRLPOOL               |                                          | http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html                                       |\n\nIf you are concerned about *security*, *state-of-the-art performance* or *whatsoever* issue,\nthen **take your time** and go setup OpenSSL or other proven library\n\nNow some features:\n* No/none tweaking knobs, it just works!\n\u003cbr /\u003e  Works out-of-the-box on little endian \u0026 big endian machines\n* Have similar performance to C implementations: see my rudimentary benchmark: [Benchmark.md](./Benchmark.md)\n\n## Prerequisites\n* Library only:\n  * [C++14 compiler](https://en.cppreference.com/w/cpp/compiler_support)\n* Tests \u0026 driver program:\n  * [Meson build system](https://mesonbuild.com/)\n  * [Ninja](https://ninja-build.org/)\n\n\n## Usage\nTo use this library in your project:\n\n1. [Download this repository](https://github.com/Chocobo1/Hash/archive/master.zip) and unzip it\n\n2. Use it like:\n    ```c++\n    // include the header\n    #include \"pathToLib/sha1.h\"\n\n    // If you are using C++14 or C++17, don't forget the \"gsl\" folder!\n\n    void example()\n    {\n      // Get an instance\n      Chocobo1::SHA1 sha1;\n\n      // Feed data \u0026 data length to it\n      sha1.addData(\"hello\", 5);\n\n      // ... or just\n      sha1.addData(\"hello\");\n\n      // Tell it to wrap it up\n      sha1.finalize();\n\n      // Profit! oops, not really...\n      std::string result = sha1.toString();\n\n      // A one-liner\n      std::string result2 = Chocobo1::SHA1().addData(\"hello\").finalize().toString();\n\n      // In byte array form\n      auto bytes = Chocobo1::SHA1().addData(\"hello\").finalize().toArray();  // std::array\u003cuint8_t, 20\u003e\n\n      // Some hash algorithm provides constexpr result under C++17\n      constexpr uint8_t data[] = {0x00, 0xFF};\n      constexpr auto bytes2 = Chocobo1::SHA1().addData(data).finalize().toArray();\n    }\n    ```\n\n3. There is also a driver program included, you can find it at \"[src/program](./src/program)\"\n\n    1. Compile:\n        ```shell\n        cd src/program\n        meson _builddir  # initialize build folder\n        cd _builddir\n        ninja            # call the `ninja` to build our program\n        ```\n\n    2. Run:\n        ```shell\n        $ ./hash -md5 /path/to/file\n        ```\n\n\n## Run Tests\n```shell\ncd tests\nmeson _build\ncd _build\nninja\n./run_tests\n```\n\n## Dependencies\n* [Microsoft/GSL](https://github.com/Microsoft/GSL) \\\n  This library is only required when compiling with C++14 and C++17. In C++20 or later,\n  `std::span` will be used in place of `gsl::span`. \\\n  No need to download or install it. This repository included a modified version that will\n  compile locally (only for `gsl::span` related headers).\n\n\n## License\nSee [LICENSE](./LICENSE) file\n\n\n## Like it?\nPlease consider [donate](https://myprojects.tzou.me/donation/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocobo1%2Fhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchocobo1%2Fhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocobo1%2Fhash/lists"}