Answer the question
In order to leave comments, you need to log in
Which algorithm (PHP function) is better to get the hash of a string for subsequent database comparison?
You have to work with long lines. Probably up to 1000 characters. Comparing such volumes is not very reasonable. Tell me, what algorithm is best to use to get the hash of these strings, in order to compare them later through the database (PostgreSQL, although this is not very important in this matter, I think) it is the hashes, because they are clearly shorter in length than the strings from which they are derived. Why is it necessary? To avoid adding rows to the table that already exist.
Answer the question
In order to leave comments, you need to log in
sha1 - there are fewer collisions, it is calculated not much longer than md5, length is 40 bytes
Actively used in the BitTorrent and Git protocol
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question