0

I would like to know when hashing a very large dynamic query with many parameters what would be the best hash algorithm to generate unique key.

Also would it be hashing the query is the best method in creating an unique key using the large query or is there any other method to create an unique key for a dynamic large query to be used in Redis its unique key.

Kalhan.Toress
  • 21,683
  • 8
  • 68
  • 92

1 Answers1

0

The answer on the first part of question is "Which hashing algorithm is best for uniqueness and speed?" quiestion. In few words - SHA1/Murmur2 look's like a potential choise.

The second is more complex and depends on hashing function. For example, Doctrine uses sha1 as hash key function as sha1(query + params). Here is nice explanation about probability of SHA1 collisions.

Community
  • 1
  • 1
Nick Bondarenko
  • 6,211
  • 4
  • 35
  • 56