File names based on file content

So, some algorithm for generating a unique, sensible length filename based on the binary content of the file. Two files with the same binary content must have the same name. Obviously there would be limitations for this, since apparently you would not have unique smallest size names for every large set of large files differing only by a small number of bits. But there seems to be some heuristic, best approximation to this, which uses the known attributes of typical image files, for example. If I had the name of some algorithm that does this, I can find it and find other approaches.

+2


a source to share


2 answers


Use MD5 hash of file content.



+5


a source


I think MD5 is worth checking out. Of course this will give you the same result if the content is the same, but I think you can increase it until you get unique.



+2


a source







All Articles