You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quickly map []byte to numbers from 0 to N, for a pre-defined set of N strings. Make []byte => Hash fast. Move the Hasher code into this repository.
Hash the []byte, check if it is lower than N, if so verify that it is the same string using bytes.Equal. The latter could be skipped if we are sure there are no collisions below a certain length of input bytes (can we optimize the search for hash seeds for this?).
From tdewolff/parse#62
Quickly map
[]byte
to numbers from 0 to N, for a pre-defined set of N strings. Make[]byte => Hash
fast. Move theHasher
code into this repository.Hash the
[]byte
, check if it is lower thanN
, if so verify that it is the same string usingbytes.Equal
. The latter could be skipped if we are sure there are no collisions below a certain length of input bytes (can we optimize the search for hash seeds for this?).Promising hash functions are https://github.com/dgryski/go-metro, https://github.com/dgryski/go-farm, and https://github.com/cespare/xxhash. Especially farm seems to be fast for short strings (len < 50).
See http://aras-p.info/blog/2016/08/09/More-Hash-Function-Tests/ for comparisons.
The text was updated successfully, but these errors were encountered: