@boia01: If a faster hash function is used, your code is one third faster than 
python.

For those who want to try: clone 
[xxHash](https://github.com/Cyan4973/xxHash.git) right next to the Nim source 
file and insert this below the _import_ statement: 
    
    
    import hashes
    
    const hashSeed: culonglong = 0x4FB3CC02B6AA901C'u64
    
    {.passC: "-DXXH_PRIVATE_API -IxxHash".}
    proc XXH64(key: pointer, size: csize, seed: culonglong): culonglong
      {.importc, header: "xxhash.h".}
    
    proc hash(s: string): Hash =
      result = XXH64(cstring(s), s.len, hashSeed).int
    

Reply via email to