fun project - improving calcHash

Walter Bright newshound2 at digitalmars.com
Mon Jun 24 13:19:35 PDT 2013


On 6/24/2013 1:08 PM, Anders Halager wrote:
> Python is one of the slower interpreted languages. It would be more interesting
> to look at luajit which actually does something clever.
> If the string is at least 4 chars long it only hashes the first 4 bytes, the
> last 4, the 4 starting at floor(len/2)-2 and the 4 starting at floor(len/4)-1.
> Any of these may overlap of course but that isn't a problem.

I used that method back in the 1980's, it was well known then, but perhaps has 
drifted into obscurity. In fact, I still use it for hashing identifiers in DMC++.



More information about the Digitalmars-d mailing list