I 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.
Yes, 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.
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.