(E-Mail Removed) pretended :
> Hi group,
>
> I need a way of calculating an unique id for a file.
>
> I've seen things like Crc32, 64, checksum .... there's a list here :
> http://en.wikipedia.org/wiki/List_of_hash_functions
>
> What is the best option for me ? I have to identify larges files and
> small files. I need something fast if possible. How can I be sure that
> it is unique ?
>
> Thanks for any advice
I don't think you can guarantee that you can identify file uniquely by
some hash code.
Say you calculate a hash of a single byte. This can hold 256 distinct
values, so by the time you encode file #257 you *will* have found a
duplicate hashcode. For a hash of a 32-bit integer, that amount is in
the billions while larger sizes go to astronomical numbers, but still
you cannot guarantee that there will be no duplicates.
As for speed, large files will require more time, as every byte has to
be read and processed.
Hans Kesting