<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Hash - 标签 - Victor's Code Journey</title><link>http://www.victorchu.info/tags/hash/</link><description>Hash - 标签 - Victor's Code Journey</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>victorchu0610@outlook.com (victorchutian)</managingEditor><webMaster>victorchu0610@outlook.com (victorchutian)</webMaster><lastBuildDate>Wed, 16 Mar 2022 22:14:54 +0800</lastBuildDate><atom:link href="http://www.victorchu.info/tags/hash/" rel="self" type="application/rss+xml"/><item><title>算法之MD5</title><link>http://www.victorchu.info/posts/2022/03/7bbf0c12/</link><pubDate>Wed, 16 Mar 2022 22:14:54 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2022/03/7bbf0c12/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/algorithm.webp" referrerpolicy="no-referrer">
            </div><p>MD5 即Message-Digest Algorithm 5 (信息-摘要算法5)。MD5 使用little-endian(小端模式)，输入任意不定长度信息，以 512-bit 进行分组，生成四个32-bit 数据，最后联合输出固定 128-bit 的信息摘要。</p>
<p>MD5 不是足够安全的。Hans Dobbertin在1996年找到了两个不同的512-bit 块,它们 在MD5 计算下产生相同的hash 值。至今还没有真正找到两个不同的消息，它们的MD5 的hash 值相等。</p>]]></description></item><item><title>算法之CRC</title><link>http://www.victorchu.info/posts/2021/12/d4df40c6/</link><pubDate>Thu, 16 Dec 2021 17:03:08 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2021/12/d4df40c6/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/algorithm.webp" referrerpolicy="no-referrer">
            </div><p>循环冗余校验（英语：Cyclic redundancy check，通称“CRC”）是一种根据网络数据包或电脑文件等数据产生简短固定位数校验码的一种散列函数，主要用来检测或校验数据传输或者保存后可能出现的错误。生成的数字在传输或者存储之前计算出来并且附加到数据后面，然后接收方进行检验确定数据是否发生变化<a href="#refer-anchor-1" rel=""><sup>1</sup></a>。</p>]]></description></item><item><title>MurmurHash</title><link>http://www.victorchu.info/posts/2021/09/bedde473/</link><pubDate>Mon, 27 Sep 2021 16:03:01 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2021/09/bedde473/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/algorithm.webp" referrerpolicy="no-referrer">
            </div><p>MurmurHash 是一种非加密hash功能，适用于基于hash的一般查找。由Austin Appleby在2008年发明， 并出现了多个变种，目前托管在<a href="https://github.com/aappleby/smhasher" target="_blank" rel="noopener noreferrer">github</a>。该名称来自两个基本操作，乘 multiply 和 旋转 rotate(该算法实际上使用shift和xor而不是rotate)，用于其内循环。与其它流行的哈希函数相比，对于规律性较强的key，MurmurHash的随机分布特征表现更良好。</p>
<p>Redis在实现字典时用到了两种不同的哈希算法，MurmurHash便是其中一种（另一种是djb），在Redis中应用十分广泛，包括数据库、集群、哈希键、阻塞操作等功能都用到了这个算法。该算法最新版本是MurmurHash3，基于MurmurHash2改进了一些小瑕疵，使得速度更快，实现了32位（低延时）、128位HashKey，尤其对大块的数据，具有较高的平衡性与低碰撞率。</p>]]></description></item><item><title>Hash算法简介</title><link>http://www.victorchu.info/posts/2018/09/62865210/</link><pubDate>Tue, 11 Sep 2018 00:40:10 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2018/09/62865210/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/algorithm.webp" referrerpolicy="no-referrer">
            </div><p>散列技术是在记录的存储位置和它的关键字之间建立一个确定的对应关系f，使得每个关键字key对应一个存储位置<code>f(key)</code>。査找时，根据这个确定的对应关系找到给定值key的映射<code>f(key)</code>,若査找集合中存在这个记录，则必定在<code>f(key)</code>的位置上。</p>
<p>我们把这种对应关系f称为散列函数，又称为哈希(Hash)函数。按这个思想，采用散列技术将记录存储在一块连续的存储空间中，这块连续存储空间称为散列表或哈希表（Hashtable)。那么关键字对应的记录存储位置我们称为散列地址。</p>]]></description></item></channel></rss>