Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unofficial ports to other languages #4

Closed
N-R-K opened this issue Nov 20, 2024 · 5 comments
Closed

Unofficial ports to other languages #4

N-R-K opened this issue Nov 20, 2024 · 5 comments

Comments

@N-R-K
Copy link
Owner

N-R-K commented Nov 20, 2024

The following are ports of ChibiHash to other languages.

Repo Language v2 v1 License
jimexist/chibihash python, rust Apache License 2.0
thevilledev/ChibiHash-rs rust MIT
eranchetz/ChibiHashGo Go Unlicense
thevilledev/ChibiHash-hs Haskell MIT
seanmiddleditch/chibihash_cpp c++ Unlicense
rainrambler/ChibiHashGo Go MIT
thevilledev/ChibiHash-zig zig MIT

Note that I do not maintain these ports, so I cannot personally verify their quality of implementation.


If you want your port to be added to the above list, then comment down below on this thread.

To test the correctness of your port, you can test against the following results which were obtained from the original implementation (Version 2):

// chibihash64(string, len, seed)  Version 2
chibihash64("", 0, 55555) => 0x58AEE94CA9FB5092
chibihash64("", 0, 0) => 0xD4F69E3ECCF128FC
chibihash64("hi", 2, 0) => 0x92C85CA994367DAC
chibihash64("123", 3, 0) => 0x788A224711FF6E25
chibihash64("abcdefgh", 8, 0) => 0xA2E39BE0A0689B32
chibihash64("Hello, world!", 13, 0) => 0xABF8EB3100B2FEC7
chibihash64("qwertyuiopasdfghjklzxcvbnm123456", 32, 0) => 0x90FC5DB7F56967FA
chibihash64("qwertyuiopasdfghjklzxcvbnm123456789", 35, 0) => 0x6DCDCE02882A4975
Below is the output from Version 1
// chibihash64(string, len, seed)  Version 1
chibihash64("", 0, 55555) => 0x2EED9399FC4AC7E5
chibihash64("", 0, 0) => 0x9EA80F3B18E26CFB
chibihash64("hi", 2, 0) => 0xAF98F3924F5C80D6
chibihash64("123", 3, 0) => 0x893A5CCA05B0A883
chibihash64("abcdefgh", 8, 0) => 0x8F922660063E3E75
chibihash64("Hello, world!", 13, 0) => 0x5AF920D8C0EBFE9F
chibihash64("qwertyuiopasdfghjklzxcvbnm123456", 32, 0) => 0x2EF296DB634F6551
chibihash64("qwertyuiopasdfghjklzxcvbnm123456789", 35, 0) => 0x0F56CF3735FFA943

There is also a community website available here: https://chibiha.sh/

(NOTE: I do not personally maintain the website either).

@N-R-K N-R-K pinned this issue Nov 20, 2024
This was referenced Nov 20, 2024
@N-R-K N-R-K changed the title Unofficial ports Unofficial ports to other languages Nov 20, 2024
@eranchetz eranchetz mentioned this issue Nov 22, 2024
@thevilledev
Copy link

Haskell implementation at https://github.com/thevilledev/ChibiHash-hs

@seanmiddleditch
Copy link

Small "port" to C++ with constexpr hashing support: https://github.com/seanmiddleditch/chibihash_cpp

@N-R-K
Copy link
Owner Author

N-R-K commented Nov 30, 2024

I've pushed the version 2 of the hash to master. It should be an all around improvement compared to version 1 so I'd suggest updating (also feel free to leave any feedback if you find any defect or area for improvement).

I've added a "Hash Version" to the above table to keep track of which port is using which version.

@thevilledev
Copy link

Thank you @N-R-K, awesome job! I've implemented support for the version 2 in the Rust version at https://github.com/thevilledev/ChibiHash-rs and it's available since v0.4.0 of the crate (link to docs). Both v1 and v2 are supported for now and v1 is the default one, until the v2 supports streaming as well. I didn't want to break any existing integrations by changing the default.

I've also built a Zig version for the v1. You may add this to the list as well: https://github.com/thevilledev/ChibiHash-zig. Both Zig and Haskell are getting the v2 treatment soon.

@thevilledev
Copy link

Zig and Haskell now support v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants