Answer the question
In order to leave comments, you need to log in
Need hash function for integer array?
Need a fast hash function to get the hash from an array of numbers. You need the same for PHP and JS (check the integrity on the client and server). If there are no ready ones, then links to algorithms for obtaining a hash from an array will also go.
Thank you.
Answer the question
In order to leave comments, you need to log in
Serialize an array (for example json) and take a hash from a string (for example md5).
When choosing hash functions, don't forget that they can create collisions.
A heuristic algorithm comes to mind - add up all the numbers in the array and either use the sum itself to check or md5 from it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question