wc-duck / pymmh3 Goto Github PK
View Code? Open in Web Editor NEWa pure python MurmurHash3 implementation.
License: Other
a pure python MurmurHash3 implementation.
License: Other
Hi
I was trying out pymmh3 with python3.4 and saw that on calling hash it gave me this error:
TypeError: string argument without an encoding
on trying to do key = bytearray( key )
(line 30)
The fix there is to call encode()
on the string before trying to call bytearray on it. I was wondering if that is the expectation for every string. It only seems to be a problem on python 3.4. Once you call encode on the string and then try it works fine.
Hi
I was trying out pymmh3 vs mmh3 (https://pypi.python.org/pypi/mmh3/2.0) and noticed that for certain inputs the value was different.
It seems to me that pymmh3.hash
returns an unsigned 32 integer vs mmh3.hash
which returns a signed 32 bit integer. Is this difference intentional?
You could try with the value 'abc' and would notice that pymmh3.hash('abc')
returns 3017643002 whereas mmh3.hash('abc')
returns -1277324294. The 2 differ by 4294967296 (which is 2^32) and so I am assuming that for negative values some addition is being done, but just wanted to confirm.
Thanks
Could you explain these two lines to me please https://github.com/wc-duck/pymmh3/blob/master/pymmh3.py#L20 + https://github.com/wc-duck/pymmh3/blob/master/pymmh3.py#L32 - what is the purpose of this?
Can't we simply use import sys
and use it? Why rename and delete it?
Also in line https://github.com/wc-duck/pymmh3/blob/master/pymmh3.py#L451 sys
is used although it doesn't exist.. so running it obviously give this error:
$: python3 pymmh3.py "foobar"
Traceback (most recent call last):
File "pymmh3.py", line 451, in <module>
sys.stdout.write( '"%s" = 0x%08X\n' % ( str_to_hash, hash( str_to_hash ) ) )
NameError: name 'sys' is not defined
I am getting segmentation fault. Are there any flags used to complile?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.