Alex Rivera | Logout

Python implementation of Jenkins Hash?

Asked 2010-07-19T08:55:40.373
23

Does there exist a native Python implementation of the Jenkins hash algorithm(s)?

I need a hash algorithm that takes an arbitrary string and turns it into an 32-bit integer. For a given string, it must guarantee to return the same integer across platforms.

I have looked at the ELF hash algorithm, of which I have found a Python implementation. Could this be a suitable replacement given the above criteria? (http://www.partow.net/programming/hashfunctions/#ELFHashFunction)

Edit
Report

1 Answer

0

There is already a "jenkins" package on PyPi. But it is not "native" as the core implementation is in C.

answered 2010-07-19T08:58:41.337

Your Answer