{"id":28624182,"url":"https://github.com/zypeh/xxhash-hs","last_synced_at":"2025-06-12T07:11:39.936Z","repository":{"id":54772317,"uuid":"334176341","full_name":"zypeh/xxhash-hs","owner":"zypeh","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-02T03:19:57.000Z","size":183,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-18T21:02:59.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zypeh.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-29T14:56:37.000Z","updated_at":"2024-04-18T21:02:59.843Z","dependencies_parsed_at":"2022-08-14T02:20:34.449Z","dependency_job_id":null,"html_url":"https://github.com/zypeh/xxhash-hs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zypeh/xxhash-hs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fxxhash-hs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fxxhash-hs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fxxhash-hs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fxxhash-hs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zypeh","download_url":"https://codeload.github.com/zypeh/xxhash-hs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fxxhash-hs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259418294,"owners_count":22854188,"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":"2025-06-12T07:11:29.877Z","updated_at":"2025-06-12T07:11:39.915Z","avatar_url":"https://github.com/zypeh.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xxhash-hs\n\n**(incomplete)** xxHash3 implementation written in Haskell.\n\nThis repo contains the undone pure Haskell XXH3 implementation which only accepts input shorter than 241 bytes. The implementation to handle longer bytes require me to grok on the XXhash C code which is written in SSE/AVX instructions.\n\nObservation from the implementation:\n\n* `fromIntegral` in Haskell is actually quite effecient as it only coerce the numeric type from one to another.\n* The only array-like data structure that is compatible with C is `Data.Array.Storable`. It requies the IO monad, so when dealing with pointer arithematics we have to use `unsafePerformIO`.\n* The XXhash3 is fast because it handle 4 bytes at a time, which is different to FNV-1 and FNV1-a that hash bytes linearly.\n\n**WIP, benchmark results.**\n\n## Comparison\nThere are a few haskell xxhash package in hackage, and here is the comparison of them:\n\n- [xxhash-ffi](https://github.com/haskell-haskey/xxhash-ffi) It is using older version of XXHash and connect with GHC FFI. It is the fastest FFI binding because it used a lot [of](https://github.com/haskell-haskey/xxhash-ffi/blob/master/src/Data/Digest/XXHash/FFI.hs#L31-L33) [tricks](https://github.com/haskell-haskey/xxhash-ffi/blob/master/src/Data/Digest/XXHash/FFI.hs#L35-L37) and specializer pragma.\n\n- [xxhash](https://github.com/christian-marie/xxhash) It is the only xxhash haskell pacakge that is officially [stated](https://code.google.com/archive/p/xxhash/) because it is implemented purely in Haskell!\n\nBoth of them are missing the XXHash3 variant which got its API stabled recently.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzypeh%2Fxxhash-hs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzypeh%2Fxxhash-hs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzypeh%2Fxxhash-hs/lists"}