Selection of non-cryptographic hash algorithm?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 views
For one samopisnogo load balancer, you should select the algorithm (non-cryptographic) checksum. Input (string keys) are always exactly 32 more bytes.


I'd love to hear the opinion of developers with a deep understanding of the topic. Which of the following algorithms would you recommend or caution against using it?


The fact that we managed to find himself:

  • fnv-1a is the most common description in the network;
  • lookup3 — what are inclined himself; in my opinion — the most optimal, but confused by the absence of references to successful application in projects, like fnv;
  • MurmurHash2 — judging by the available tests — the fastest, there is a history of use (libmemcached, Hadoop); but some inadequate collisions on certain test kits — simon-says.vox.com/library/post/murmur-hash-very-f... — "...one pathological input sequence of 2^32 values causes the algorithm to suffer from a rate of hash collision as high as 97.6%"
by | 19 views

2 Answers

0 like 0 dislike
If not much bother, in the book of Kernighan and Pike's "Practice of programming" is a fairly simple algorithm:
enum { MULTIPLIER = 31 };
/* hash: compute
the hash function of the string */
unsigned int hash(char *str)
{
unsigned int h;
unsigned char *p;
h = 0;
for (p = (unsigned char *)
str; *p != '\\0'; p++)
h = MULTIPLIER * h +
*p; return h % table nhash; }
by
0 like 0 dislike
While numerous variations of CRC-why not suitable?
by

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
asked Mar 25, 2019 by extratag
110,608 questions
257,186 answers
0 comments
22,471 users