8000 murmur3 compatibility with other libraries · Issue #71 · flier/pyfasthash · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
murmur3 compatibility with other libraries #71
Open
@dhulchuk

Description

@dhulchuk

In case someone is locked to this not maintained package due to different behaviour of murmur3_32 on strings.
You can get the same hash by adding zero byte after every symbol.
Example for mmh3 library:

import pyhash
import mmh3

zero_spaced_string = ''.join(x + '\x00' for x in original_string)
assert mmh3.hash(zero_spaced_string, signed=False) == pyhash.murmur3_32()(original_string)

This may not be general solution, but it works for my setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0