Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Question about checksum/secure

From: holger:rebol at: 19-Nov-2001 6:20

On Mon, Nov 19, 2001 at 04:06:06PM +1100, Brett Handley wrote:
> I hope this isn't a silly question. > > Can the result of checksum/secure be used like a GUID, is it guaranteed to > be unique?
No, hashing is a many-to-one operation, mapping from an infinite space (arbitrarily long string series) to a finite space (string series of length 20), so there always has to be the chance of collisions. The chance of a collision is very small though, especially if you deal with a small number of values, say, less than a billion billion billion :-). For any two arbitrary strings to have the same checksum the chance is 1/(2^160). For at least one collision among n strings the chance is n/(2^160) (for n <= 2^160, obviously). -- Holger Kruse [holger--rebol--com]