{"id":28463837,"url":"https://github.com/galactixx/zighash","last_synced_at":"2025-08-02T03:12:59.628Z","repository":{"id":295934836,"uuid":"987832962","full_name":"galactixx/zighash","owner":"galactixx","description":"Zighash is a Zig package for generating non-cryptographic hash values using a variety of popular algorithms: FNV-1a, MurmurHash3, SpookyHash, xxHash, SuperFastHash, and CityHash. Perfect for hash-based data structures, checksums, deduplication, and performance-sensitive applications.","archived":false,"fork":false,"pushed_at":"2025-06-26T03:11:27.000Z","size":3062,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T04:19:36.497Z","etag":null,"topics":["hashing","zig","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galactixx.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}},"created_at":"2025-05-21T16:48:01.000Z","updated_at":"2025-06-26T03:11:36.000Z","dependencies_parsed_at":"2025-05-28T05:38:57.476Z","dependency_job_id":"250d7648-a30f-453b-b8b1-410f907fa5c1","html_url":"https://github.com/galactixx/zighash","commit_stats":null,"previous_names":["galactixx/zighash"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/galactixx/zighash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galactixx%2Fzighash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galactixx%2Fzighash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galactixx%2Fzighash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galactixx%2Fzighash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galactixx","download_url":"https://codeload.github.com/galactixx/zighash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galactixx%2Fzighash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268330935,"owners_count":24233152,"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-08-02T02:00:12.353Z","response_time":74,"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":["hashing","zig","zig-package","ziglang"],"created_at":"2025-06-07T05:01:18.516Z","updated_at":"2025-08-02T03:12:59.613Z","avatar_url":"https://github.com/galactixx.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/docs/logo.png\" alt=\"zighash logo\" width=\"75%\"/\u003e\n\u003c/p\u003e\n\nZighash is a Zig package for generating non-cryptographic hash values using a variety of popular algorithms: **FNV-1a**, **MurmurHash3**, **SpookyHash**, **xxHash**, **SuperFastHash**, and **CityHash**.\n\n## ✨ **Features**\n\n* **Multiple Hash Algorithms:**\n\n  * **FNV-1a:** `fnv1aHash32`, `fnv1aHash64`\n  * **SuperFastHash:** `superFastHash32`\n  * **MurmurHash3:** `murmur3Hash32`\n  * **SpookyHash:** `spookyHash32`, `spookyHash64`\n  * **xxHash:** `xxHash32`, `xxHash64`\n  * **CityHash:** `cityHash32`, `cityHash64`\n\n## 🚀 Getting Started\n\n### Fetch via `zig fetch`\n\nYou can use the built‑in Zig fetcher to download and pin a tarball:\n\n```bash\nzig fetch --save git+https://github.com/galactixx/zighash#v0.2.0\n```\n\n\u003e This adds an `zighash` entry under `.dependencies` in your `build.zig.zon`. \n\nThen in your build.zig:\n\n```zig\nconst zighash_mod = b.dependency(\"zighash\", .{\n    .target = target,\n    .optimize = optimize,\n}).module(\"zighash\");\n\n// add to library\nlib_mod.addImport(\"zighash\", zighash_mod);\n\n// add to executable\nexe.root_module.addImport(\"zighash\", zighash_mod);\n```\n\nThis lets you `const zh = @import(\"zighash\");` in your Zig code.\n\n## 📚 **Usage**\n\n```zig\nconst std = @import(\"std\");\nconst zh  = @import(\"zighash\");\n\npub fn main() void {\n    const key = \"Hello, Zig!\";\n    const hash32 = zh.fnv1aHash32(key);\n    const hash64 = zh.xxHash64(key);\n\n    std.debug.print(\"FNV-1a 32-bit: {x}\\n\", .{hash32});\n    std.debug.print(\"xxHash 64-bit: {x}\\n\", .{hash64});\n}\n```\n\n## 🔍 **API**\n\n### FNV-1a\n\n```zig\npub fn fnv1aHash32(key: []const u8) u32\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice (`[]const u8`) to hash.\n* **Returns:** A 32-bit unsigned integer (`u32`) representing the FNV-1a hash.\n\n```zig\npub fn fnv1aHash64(key: []const u8) u64\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n* **Returns:** A 64-bit unsigned integer (`u64`) representing the FNV-1a hash.\n\n---\n\n### MurmurHash3\n\n```zig\npub fn murmur3Hash32(key: []const u8, seed: u32) u32\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n  * `seed`: The 32-bit seed.\n* **Returns:** A 32-bit unsigned integer (`u32`) computed by MurmurHash3.\n\n---\n\n### SpookyHash\n\n```zig\npub fn spookyHash32(key: []const u8, seed: u32) u32\npub fn spookyHash64(key: []const u8, seed: u64) u64\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n  * `seed`: The 32-bit (`u32`) or 64-bit (`u64`) seed.\n* **Returns:** 32-bit (`u32`) or 64-bit (`u64`) hash values.\n\n---\n\n### xxHash\n\n```zig\npub fn xxHash32(key: []const u8, seed: u32) u32\npub fn xxHash64(key: []const u8, seed: u64) u64\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n  * `seed`: The 32-bit (`u32`) or 64-bit (`u64`) seed.\n* **Returns:** 32-bit or 64-bit non-cryptographic hash.\n\n---\n\n### SuperFastHash\n\n```zig\npub fn superFastHash32(key: []const u8) u32\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n* **Returns:** A 32-bit non-cryptographic hash.\n\n---\n\n### CityHash\n\n```zig\npub fn cityHash32(key: []const u8) u32\npub fn cityHash64(key: []const u8) u64\n```\n\n* **Parameters:**\n\n  * `key`: The input byte slice.\n* **Returns:** 32-bit or 64-bit hash optimized for varied input lengths.\n\n## 🤝 **License**\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## 📞 **Contact**\n\nHave questions or want to contribute? Open an issue or pull request on [GitHub](https://github.com/galactixx/zighash).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalactixx%2Fzighash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalactixx%2Fzighash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalactixx%2Fzighash/lists"}