1
$\begingroup$

This question was originally posted on super user, but redirected here based on some suggestions.

I am completely new with computer science, and not only recently did I run into the notion of hashing. Currently, I use md5sum for indexing reason, but am curious if hash functions can do more things. After educating myself on the surface by reading the wikipedia page on hash functions, I wondered if continuous hash functions can be made true. Luckily, it is called locality sensitive hashing, and I can find open algorithms online.

What makes me more curious, and is something that I have not found, is can I further ask the continuous hash functions to preserve structure? More specifically, the problem I have in mind is to index all of the files I have. Not only do I hope the indexing to be continuous (so the hash won't change too much while I minor-edit a file), I also want it to preserve structure (so for example if I concatenate two files, the hash of the third file should be a reasonable function in the hash of the first two).

Please let me know if I should provide more specific information. Again, I am completely new to this field, so I might have missed something obvious.

$\endgroup$
  • $\begingroup$ That is not a good idea. That hash function will be weak about finding collisions. $\endgroup$ – kelalaka Feb 10 at 10:14
  • $\begingroup$ I don't see why that's the case. .. Would you please elaborate? $\endgroup$ – Student Feb 10 at 14:55
  • 1
    $\begingroup$ Since you tagged encryption, in short, due to the avalanche criteria, from Cryptographic Hash functions we want; changing one bit in the input, should change half of the output bit, randomly. If not, your hash function will have non-generic collisions. $\endgroup$ – kelalaka Feb 10 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.