{"id":22685956,"url":"https://github.com/bytehamster/fips","last_synced_at":"2026-02-26T03:38:36.271Z","repository":{"id":266100598,"uuid":"833541538","full_name":"ByteHamster/FiPS","owner":"ByteHamster","description":"A very simple and fast implementation of perfect hashing through fingerprinting.","archived":false,"fork":false,"pushed_at":"2025-03-31T12:18:08.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T13:18:19.576Z","etag":null,"topics":[],"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/ByteHamster.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}},"created_at":"2024-07-25T09:04:57.000Z","updated_at":"2025-03-31T12:18:12.000Z","dependencies_parsed_at":"2024-12-02T15:44:58.735Z","dependency_job_id":"093758b1-61c0-4a84-9345-915d3f868d48","html_url":"https://github.com/ByteHamster/FiPS","commit_stats":null,"previous_names":["bytehamster/fips"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FFiPS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FFiPS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FFiPS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FFiPS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteHamster","download_url":"https://codeload.github.com/ByteHamster/FiPS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250246728,"owners_count":21398919,"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":[],"created_at":"2024-12-09T22:19:58.951Z","updated_at":"2026-02-26T03:38:36.225Z","avatar_url":"https://github.com/ByteHamster.png","language":"C++","readme":"# FiPS\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n![Build status](https://github.com/ByteHamster/FiPS/actions/workflows/build.yml/badge.svg)\n\nA minimal perfect hash function (MPHF) maps a set S of n keys to the first n integers without collisions.\nPerfect hash functions have applications in databases, bioinformatics, and as a building block of various space-efficient data structures.\n\nFiPS (**Fi**nperprint **P**erfect Hashing through **S**orting) is a very simple\nand fast implementation of [perfect hashing through fingerprinting](https://doi.org/10.1007/978-3-319-07959-2_12).\n\nThe idea of perfect hashing through fingerprinting is to hash each input key to a fingerprint.\nAn array stores a bit for each possible fingerprint indicating whether keys collided.\nColliding keys are handled in another layer of the same data structure.\nThere are many implementations of the approach, for example [FMPH (Rust)](https://docs.rs/ph/latest/ph/).\n\nThe construction of perfect hashing through fingerprinting is usually implemented as a linear scan,\nproducing a fault for every key.\nInstead, FiPS is based on sorting the keys, which is more cache friendly and faster.\nAlso, it interleaves its select data structure with the payload data, which enables very fast queries.\nLastly, the FiPS implementation is very simple, with just about 200 lines of code.\n\n### Library usage\n\nClone this repository (with submodules) and add the following to your `CMakeLists.txt`.\n\n```\nadd_subdirectory(path/to/FiPS)\ntarget_link_libraries(YourTarget PRIVATE FiPS::fips)\n```\n\nYou can construct a FiPS perfect hash function as follows.\n\n```cpp\nstd::vector\u003cstd::string\u003e keys = {\"abc\", \"def\", \"123\", \"456\"};\nfips::FiPS\u003c\u003e hashFunc(keys, /* gamma = */ 2.0f);\nstd::cout \u003c\u003c hashFunc(\"abc\") \u003c\u003c std::endl;\n```\n\n### Licensing\nThis code is licensed under the [GPLv3](/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehamster%2Ffips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytehamster%2Ffips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehamster%2Ffips/lists"}