{"id":31872188,"url":"https://github.com/newyaroslav/siphash-cpp","last_synced_at":"2025-10-12T21:52:39.300Z","repository":{"id":162735413,"uuid":"415222801","full_name":"NewYaroslav/siphash-cpp","owner":"NewYaroslav","description":"SipHash Headers Only C ++ Library","archived":false,"fork":false,"pushed_at":"2025-09-04T13:38:21.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T14:40:34.592Z","etag":null,"topics":["c-plus-plus","cpp11","cpp17","cryptographic-hash-functions","cryptography","hash","library","pseudorandom-functions","siphash"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NewYaroslav.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2021-10-09T06:26:15.000Z","updated_at":"2025-09-04T13:52:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8ecf98e-c081-44db-bddf-1010200e9d22","html_url":"https://github.com/NewYaroslav/siphash-cpp","commit_stats":null,"previous_names":["newyaroslav/siphash-cpp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NewYaroslav/siphash-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fsiphash-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fsiphash-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fsiphash-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fsiphash-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NewYaroslav","download_url":"https://codeload.github.com/NewYaroslav/siphash-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fsiphash-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013127,"owners_count":26085232,"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-12T02:00:06.719Z","response_time":53,"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":["c-plus-plus","cpp11","cpp17","cryptographic-hash-functions","cryptography","hash","library","pseudorandom-functions","siphash"],"created_at":"2025-10-12T21:52:36.898Z","updated_at":"2025-10-12T21:52:39.290Z","avatar_url":"https://github.com/NewYaroslav.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# siphash_cpp\n\n[![Linux](https://github.com/NewYaroslav/siphash-cpp/actions/workflows/CI-Linux.yml/badge.svg)](https://github.com/NewYaroslav/siphash-cpp/actions/workflows/CI-Linux.yml)\n[![Win](https://github.com/NewYaroslav/siphash-cpp/actions/workflows/CI-Win.yml/badge.svg)](https://github.com/NewYaroslav/siphash-cpp/actions/workflows/CI-Win.yml)\n\n[SipHash](https://en.wikipedia.org/wiki/SipHash) header only C ++ library.\n\nSipHash is a family of keyed hash functions optimized for short messages. It is widely used to protect hash tables from collision attacks and to authenticate lightweight data.\n\n### Advantages\n- Secret key makes hash-flooding attacks impractical\n- Small, simple code that runs quickly on short inputs\n\n### Limitations\n- Slower than non-cryptographic hashes such as MurmurHash\n- 64-bit output is not meant for high-security message authentication or large files\n\nThe key must contain at least 16 bytes.\n\nExample:\n\n```cpp\n#include \"siphash.hpp\"\n\n\\\\...\n\nstd::array\u003cchar, 16\u003e key = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\nstd::string data(\"hello\");\n\nstd::cout \u003c\u003c \"SipHash-2-4 for 'hello': \" \u003c\u003c siphash_cpp::siphash_2_4(data, key) \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"SipHash-4-8 for 'hello': \" \u003c\u003c siphash_cpp::siphash_4_8(data, key) \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"SipHash-4-8 for 'hello': \" \u003c\u003c siphash_cpp::siphash(data, key, 4, 8) \u003c\u003c std::endl;\n\nsiphash_cpp::SipHash siphash;\nsiphash.init(key, 2, 4);\nstd::cout \u003c\u003c \"SipHash-2-4 for 'hello': \" \u003c\u003c siphash.update(data).digest() \u003c\u003c std::endl;\n```\n\n## Installation\n\n### vcpkg\n\nThis library can be installed with [vcpkg](https://github.com/microsoft/vcpkg):\n\n```sh\nvcpkg install siphash-cpp\n```\n\nAfter installation, a CMake project may use:\n\n```cmake\nfind_package(siphash_cpp CONFIG REQUIRED)\ntarget_link_libraries(your_app PRIVATE siphash_cpp::siphash_cpp)\n```\n\nTo verify the build with vcpkg, run:\n\n```sh\nVCPKG_ROOT=/path/to/vcpkg ./scripts/run_tests.sh\n```\n\n### Git submodule\n\n```sh\ngit submodule add https://github.com/NewYaroslav/siphash-cpp.git external/siphash-cpp\n```\n\nThen add the subdirectory and link the target in your `CMakeLists.txt`:\n\n```cmake\nadd_subdirectory(external/siphash-cpp)\ntarget_link_libraries(your_app PRIVATE siphash_cpp::siphash_cpp)\n```\n\n## Related Projects\n\n- [hmac-cpp](https://github.com/NewYaroslav/hmac-cpp)\n- [aes-cpp](https://github.com/NewYaroslav/aes-cpp)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Fsiphash-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewyaroslav%2Fsiphash-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Fsiphash-cpp/lists"}