0

For a given string, and its slight mutation, usual hashes are unpredictably different. Is there some algorithm that maintains some amount of prefix when changes are minor?

hash("That is all they want to teach you") -> da9dad9039d33d3dkdkd
hash("And that is all they want to make you!") -> da9dad9039d3gs09fsd0

Is there some algorithm that lends to comparison, returning a value from 0 to 1?

compare(hash(s1), hash(s2)) -> 0.7
Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202

1 Answers1

2

Here is a reference:

http://en.wikipedia.org/wiki/Locality-sensitive_hashing

taken from this question:

String similarity score/hash

which is almost a duplicate..

Community
  • 1
  • 1
WeaselFox
  • 7,220
  • 8
  • 44
  • 75