使用 32 位哈希时发生冲突的概率 [英] Probability of collision when using a 32 bit hash

查看:30
本文介绍了使用 32 位哈希时发生冲突的概率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有一个 10 个字符的字符串键字段.我已经使用 CRC32 来散列这个字段,但我担心重复.有人能告诉我在这种情况下发生碰撞的概率吗?

I have a 10 character string key field in a database. I've used CRC32 to hash this field but I'm worry about duplicates. Could somebody show me the probability of collision in this situation?

附言我的字符串字段在数据库中是唯一的.如果字符串字段数为 100 万,碰撞概率是多少?

p.s. my string field is unique in the database. If the number of string fields is 1 million, what is probability of collision ?

推荐答案

预期重复完美 32 位 crc 的碰撞

答案参考了这篇文章:http://arstechnica.com/civis/viewtopic.php?f=20&t=149670

找到以下图片:http://preshing.com/20110504/hash-collision-概率

这篇关于使用 32 位哈希时发生冲突的概率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆