chapter_hashing/hash_algorithm/ #556
Replies: 27 comments 29 replies
-
看不明白,如果整数的哈希值就是本身的话,不就没有映射了吗?求解答 orz |
Beta Was this translation helpful? Give feedback.
-
大佬们这个上一页和下一页能把不能挪到评论区上面,或者是映射个快捷键,总是去点目录感觉有些不舒服 |
Beta Was this translation helpful? Give feedback.
-
也就是说完备的哈希算法可以广泛运用于数据安全验证中,防篡改 |
Beta Was this translation helpful? Give feedback.
-
现在政府项目开始使用SM3了。 |
Beta Was this translation helpful? Give feedback.
-
为什么我用c++代码跑出来的hash值和文章中的不一致? |
Beta Was this translation helpful? Give feedback.
-
hash算法其中一个重要原则是“确定性”,与上面“随机盐”就矛盾了 |
Beta Was this translation helpful? Give feedback.
-
大佬可以推荐几个相应的练习题网站或者leecode题库吗 |
Beta Was this translation helpful? Give feedback.
-
讲得很透彻,对于入门级来说,是一个不可多得学习资料,谢谢大佬 |
Beta Was this translation helpful? Give feedback.
-
关于哈希函数,推荐一篇文章,可以配合着看 |
Beta Was this translation helpful? Give feedback.
-
书中说加法哈希无法区分内容相同但顺序不同的字符串,是不是内容不同加法哈希也可能产生哈希冲突,比如“ad"和"cb","cam"和"nab" |
Beta Was this translation helpful? Give feedback.
-
请问大佬,旋转哈希中的这个旋转 /* 旋转哈希 */
function rotHash(key) {
let hash = 0;
const MODULUS = 1000000007;
for (const c of key) {
hash = ((hash << 4) ^ (hash >> 28) ^ c.charCodeAt(0)) % MODULUS;
}
return hash;
} |
Beta Was this translation helpful? Give feedback.
-
如果说数值的hash值是本身,那么意味着存在某个字符串和某个数值的key, 映射冲突吗? |
Beta Was this translation helpful? Give feedback.
-
这一节的哈希算法是对上两节的value做key吧。也就是对要存的字符串赋予编号 |
Beta Was this translation helpful? Give feedback.
-
数据结构的哈希值中,是不是将数据看成value,其哈希值看成是key? |
Beta Was this translation helpful? Give feedback.
-
所以JS/TS 的hash算法为什么没暴露出来?还要去v8里去看 |
Beta Was this translation helpful? Give feedback.
-
hash & mod ,mod不应该是二进制数吗?感谢 |
Beta Was this translation helpful? Give feedback.
-
python里面 hash(-1)=-2,hash(-2)=-2,这是咋回事啊 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
数据完整性检查:数据发送方可以计算数据的哈希值并将其一同发送;接收方可以重新计算接收到的数据的哈希值,并与接收到的哈希值进行比较。如果两者匹配,那么数据就被视为完整。 |
Beta Was this translation helpful? Give feedback.
-
作者您好,在C++中,std::vector的底层实现为迭代器。也就是说动态数组中的元素并不是其成员。那么一个std::vector对象是否为可哈希的呢?因为其成员的内存地址不变,只是其存放元素的地址在变化(即成员迭代器的值变化了) |
Beta Was this translation helpful? Give feedback.
-
作者你好 |
Beta Was this translation helpful? Give feedback.
-
感觉缺少一致性 hash 的介绍。包括 hashring 环法,或者 jumphash 这些。这些在负载均衡领域很通用。 |
Beta Was this translation helpful? Give feedback.
-
哈希表章节看完了,但还是没有明白这个哈希表到底起什么用,容量如何设计的。如果哈希表是一个数组存储,那么这个章节中讲的hash算法计算key,这个key怎么确保是数组长度内的索引呢?如果哈希表不是数组存储,那么上一章节讲到的线性探测、平方探测等如何能实现呢 |
Beta Was this translation helpful? Give feedback.
-
实在是无法理解哈希表的作用 |
Beta Was this translation helpful? Give feedback.
-
什么情况下,需要将大的输入空间映射到小的输出空间呢?为什么哈希表采用数组结构,而不是直降将key作为字符串索引存储到对象中呢 |
Beta Was this translation helpful? Give feedback.
-
chapter_hashing/hash_algorithm/
动画图解、一键运行的数据结构与算法教程
https://www.hello-algo.com/chapter_hashing/hash_algorithm/
Beta Was this translation helpful? Give feedback.
All reactions