# Binary simmilarity function [closed]

I've been reading about hash functions, but found nothing close to solve this problem - I'm looking for a function with could be used for binary comparison of multiple files / streams of bytes etc. Assume files:

1. for file A we have 01000010100
2. for file B we have 01000000000
3. for file C we have 0100001
4. for file D we have 11111000000
5. for file E we have 010000101

Now, goal is to find out which files have smallest - sorry if I misuse term here - "newtons distance". So basically, I would expect an algorithm that can state that for file A files B and E are "close" match.

Does such function exist, or one would need to use combination of several?

Sorry if I'm posting this on the wrong SE network. I could not decide if this belongs to Mathematics or Computational Science, better so decided to go for Cryptography. I'm pretty sure they'll create "StackAlgorithm" soon. :)

Edit:

Or perhaps I'll elaborate.

Imagine we have 10k samples of various sizes. 1-10MB. Might be varied amplitude digital signals, might be un-normalized audio samples, I want to make it irrelevant. Goal is to keep database of such hashes to quickly select similar input, whether "shorter" or just partially different but same size.

-
I think this simhash.googlecode.com/svn/trunk/paper/SimHashWithBib.pdf is defines problem well –  user11372 Jan 11 at 18:02
This isn't really a cryptography question, even if it's kind of close. Stack Overflow does allow algorithm design questions, so you could ask this there. Alternatively, Computer Science (as opposed to Computational Science) Stack Exchange could be another option. –  Ilmari Karonen Jan 12 at 7:02
This has nothing to do with cryptography. Your question is probably one for Computer Science, but your problem statement is very hard to understand. It looks like you're trying to build a fuzzy matching algorithm, but this is very dependent on the type of data, since the nature of the transformations that don't matter depends a lot on the nature of the data. –  Gilles Jan 12 at 19:48