tigrou
tigrou

Reputation: 4516

Is there more chance having collisions between GUID's or a SHA1 hashes of GUID's?

Is there more chance having collisions when betweens GUID's (128 bits) or SHA1 hashes of GUID's (160 bits) ? My opinion is there is less chance with a GUID (even if there is 32 bit less), because it has some special mechanisms to make sure it is (almost, because no guarantee) unique (ex : timestamp)

Note : i already know that a GUID is very unlikely to have a collision with another GUID, no more debate about this please.

Upvotes: 3

Views: 1702

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21507

That's trivial: if two GUIDs are the same (that is, for each GUID collision), their hashes are also the same (we have a "collision" which is not a "SHA1 collision", but it's bad enough for our application). Plus there is a probability of a hash collision proper (same SHA1 for different GUIDs).

You can only add collisions if you hash your GUIDs.

Upvotes: 9

Related Questions