Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hash stable to small changes in text [closed]

Tags:

algorithm

hash

Is there a hash function that is stable to small changes in text? I'm looking for the opposite of a cryptographic hash, where small changes in the source lead to huge changes in the result.

Something like a perceptual hash for text. Is there such a thing?

Edited: by "small changes in text" I mean changes in punctuation, correction of ortographic / grammatical mistakes, etc. The text itself is an article, like a wikipedia entry (but it can be much smaller, like 2 or 3 paragraphs).

Bonus points if somebody can point to a Python implementation.

like image 292
Joaquin Cuenca Abela Avatar asked Dec 02 '10 23:12

Joaquin Cuenca Abela


People also ask

What happens to a hash if you change the input values?

For every input, you get a unique hash output. Once you create a hash, the only way to get the same exact hash is to input the same text. If you change even just one character, the hash value will change as well.

Are hashes fixed size?

A hash is a function that meets the encrypted demands needed to solve for a blockchain computation. Hashes are of a fixed length since it makes it nearly impossible to guess the length of the hash if someone was trying to crack the blockchain. The same data will always produce the same hashed value.

Which hashing technique is best?

SHA-256: This hashing algorithm is a variant of the SHA2 hashing algorithm, recommended and approved by the National Institute of Standards and Technology (NIST). It generates a 256-bit hash value. Even if it's 30% slower than the previous algorithms, it's more complicated, thus, it's more secure.

Do hashes change?

The contents of a file are processed through a cryptographic algorithm, and a unique numerical value – the hash value - is produced that identifies the contents of the file. If the contents are modified in any way, the value of the hash will also change significantly.


1 Answers

You're looking for locality sensitive hashing.

like image 71
Keith Randall Avatar answered Sep 23 '22 16:09

Keith Randall