nebula-python
nebula-python copied to clipboard
feat: add MurmurHash2 hash() and unit+integration tests
What type of PR is this?
- [ ] bug
- [x] feature
- [ ] enhancement
What problem(s) does this PR solve?
Issue(s) number:
- Closes #355
Description:
- Add a new
murmur_hashfunction (MurmurHash2 64-bit variant) undernebula3/utils/hash.py - Remove ctypes dependency and use
int.from_bytesfor better performance and readability - Support both
str(UTF-8) andbytesinputs, with appropriate type checking - Add comprehensive unit tests (
tests/test_hash.py) covering:- Empty input, single byte, exactly 8 bytes, >8 bytes, Unicode strings
- Seed variation, idempotency, invalid types, large inputs
- Add integration tests (
tests/test_hash_integration.py) to verify clienthash()against serverYIELD hash(...)
looks like our runner's pdm env is dirty, trying to run py310's pdm code on py37, where there are walrus symbol := that's foreign to py37.