GUID或SHAD的GUID哈希之间是否有更多的冲突? [英] Is there more chance having collisions between GUID's or a SHA1 hashes of GUID's?
问题描述
在 GUID的
(128位)或 GUID的
(160位)的SHA1散列之间是否有更多的碰撞机会)?我认为使用 GUID
的机会更少(即使少了32位),因为它有一些特殊的机制来确保它(几乎没有保证) )唯一(例如:时间戳)
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)
注意:我已经知道 GUID
不太可能发生冲突还有另一个 GUID
,请不要对此进行更多辩论。
Note : i already know that a GUID
is very unlikely to have a collision with another GUID
, no more debate about this please.
推荐答案
琐碎的:如果两个GUID相同(即,对于每个GUID碰撞),它们的哈希也相同(我们有一个碰撞,不是 SHA1碰撞,但这很糟糕)足以用于我们的应用程序)。加上散列冲突的可能性也很适当(对于不同的GUID,SHA1相同)。
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).
仅在对GUID进行散列时才可以添加冲突。
You can only add collisions if you hash your GUIDs.
这篇关于GUID或SHAD的GUID哈希之间是否有更多的冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!