4 ms·
If someone manages to port the 64-bit version to Java (which probably requires some JNI or JNA work), I would be very happy.
by jmhodges 17y ago
If someone manages to port the 64-bit version to Java (which probably requires some JNI or JNA work), I would be very happy.
- codahale 17y agoI just ported it to Java. It took me five minutes. It's 40 lines of C++, most of which are of the `k *= m;` variety. You literally paste in the C++, fix the type declarations, and replace the point increment looping with standard indexed array iteration. Remember to replace `const` with `final` and you're done. Using JNI for a high-speed hash function makes only slightly more sense than putting a SOAP interface on it.
- jmhodges 17y agoYes, and those "k = m" lines are the problem! Those assume unsigned* types! And 64-bit integers! Those multiplications and other operations are all wrong! You didn't port this to Java, you ported a broken algorithm to Java. Way to go, though.
- jmhodges 17y agoSorry, not 64-bit integers but you get my drift.