{"id":16572766,"url":"https://github.com/lemire/rollinghashjava","last_synced_at":"2025-03-21T12:31:13.681Z","repository":{"id":66054931,"uuid":"1468436","full_name":"lemire/rollinghashjava","owner":"lemire","description":"Rolling hash functions in Java","archived":false,"fork":false,"pushed_at":"2016-05-07T23:15:49.000Z","size":4,"stargazers_count":75,"open_issues_count":0,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-12T21:28:35.927Z","etag":null,"topics":["hashing","java","rolling-hash-functions"],"latest_commit_sha":null,"homepage":"http://code.google.com/p/rollinghashjava/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2011-03-11T15:45:30.000Z","updated_at":"2023-09-08T16:28:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"d75e8446-5b38-46ba-bdf0-4e47db9fe754","html_url":"https://github.com/lemire/rollinghashjava","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/lemire%2Frollinghashjava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Frollinghashjava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Frollinghashjava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Frollinghashjava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemire","download_url":"https://codeload.github.com/lemire/rollinghashjava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221815131,"owners_count":16885127,"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":["hashing","java","rolling-hash-functions"],"created_at":"2024-10-11T21:28:32.202Z","updated_at":"2024-10-28T10:07:16.801Z","avatar_url":"https://github.com/lemire.png","language":"Java","readme":"## Rolling hash functions in Java\n\nLicense: Apache 2.0\n\n## What is this?\n\nThis is a set of Java classes implementing various recursive n-gram hashing techniques, also called rolling hashing (http://en.wikipedia.org/wiki/Rolling_hash), including:\n\n* Randomized Karp-Rabin (sometimes called Rabin-Karp)\n* Hashing by Cyclic Polynomials (also known as Buzhash)\n\n\n## Code sample\n\n```java\nString s = \"some string\";\nint n = 3; //hash all sequences of 3 characters\nCyclicHash ch = new CyclicHash(n);\nint k = 0;\nfor(; k\u003cn;++k) {\n  ch.eat(s.charAt(k));\n}\nint rollinghash = ch.eat(s.charAt(k)); // the first or last 32-(n-1) bits are strongly universal\n// do something with the hash value\nfor(;k\u003cs.length();++k) {\n  rollinghash = ch.update(s.charAt(k-n), s.charAt(k));\n  // do something with the hash value\n}\n```\n\n## Reference \n\nDaniel Lemire, Owen Kaser: Recursive n-gram hashing is pairwise independent, at best, Computer Speech \u0026 Language, Volume 24, Issue 4, October 2010, Pages 698-710 http://arxiv.org/abs/0705.4676\n","funding_links":[],"categories":["Memory and concurrency"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Frollinghashjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemire%2Frollinghashjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Frollinghashjava/lists"}