<bdo id='KH6d9'></bdo><ul id='KH6d9'></ul>

    <small id='KH6d9'></small><noframes id='KH6d9'>

  1. <legend id='KH6d9'><style id='KH6d9'><dir id='KH6d9'><q id='KH6d9'></q></dir></style></legend>

  2. <i id='KH6d9'><tr id='KH6d9'><dt id='KH6d9'><q id='KH6d9'><span id='KH6d9'><b id='KH6d9'><form id='KH6d9'><ins id='KH6d9'></ins><ul id='KH6d9'></ul><sub id='KH6d9'></sub></form><legend id='KH6d9'></legend><bdo id='KH6d9'><pre id='KH6d9'><center id='KH6d9'></center></pre></bdo></b><th id='KH6d9'></th></span></q></dt></tr></i><div id='KH6d9'><tfoot id='KH6d9'></tfoot><dl id='KH6d9'><fieldset id='KH6d9'></fieldset></dl></div>

      <tfoot id='KH6d9'></tfoot>

      非加密用途的最快哈希?

      时间:2023-10-03

        <i id='UTZ3D'><tr id='UTZ3D'><dt id='UTZ3D'><q id='UTZ3D'><span id='UTZ3D'><b id='UTZ3D'><form id='UTZ3D'><ins id='UTZ3D'></ins><ul id='UTZ3D'></ul><sub id='UTZ3D'></sub></form><legend id='UTZ3D'></legend><bdo id='UTZ3D'><pre id='UTZ3D'><center id='UTZ3D'></center></pre></bdo></b><th id='UTZ3D'></th></span></q></dt></tr></i><div id='UTZ3D'><tfoot id='UTZ3D'></tfoot><dl id='UTZ3D'><fieldset id='UTZ3D'></fieldset></dl></div>
        1. <small id='UTZ3D'></small><noframes id='UTZ3D'>

            <bdo id='UTZ3D'></bdo><ul id='UTZ3D'></ul>

          • <tfoot id='UTZ3D'></tfoot>
            <legend id='UTZ3D'><style id='UTZ3D'><dir id='UTZ3D'><q id='UTZ3D'></q></dir></style></legend>

                  <tbody id='UTZ3D'></tbody>
                本文介绍了非加密用途的最快哈希?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我基本上是在准备要放入数据库的短语,它们可能格式不正确,所以我想存储它们的短散列(我将简单地比较它们是否存在,因此散列是理想的).

                I'm essentially preparing phrases to be put into the database, they may be malformed so I want to store a short hash of them instead (I will be simply comparing if they exist or not, so hash is ideal).

                我认为 MD5 在 100,000 多个请求上相当慢,所以我想知道散列短语的最佳方法是什么,也许推出我自己的散列函数或使用 hash('md4', '...' 最终会更快吗?

                I assume MD5 is fairly slow on 100,000+ requests so I wanted to know what would be the best method to hash the phrases, maybe rolling out my own hash function or using hash('md4', '...' would be faster in the end?

                我知道 MySQL 有 MD5(),所以这会在查询端增加一点速度,但也许 MySQL 中还有一个更快的散列函数,我不知道它是否适用于 PHP..

                I know MySQL has MD5(), so that would complement a bit of speed on the query end, but maybe there's further a faster hashing function in MySQL I don't know about that would work with PHP..

                推荐答案

                CRC32 非常快,并且有一个函数:http://www.php.net/manual/en/function.crc32.php

                CRC32 is pretty fast and there's a function for it: http://www.php.net/manual/en/function.crc32.php

                但是您应该知道 CRC32 比 MD5 甚至 SHA-1 哈希具有更多的冲突,这仅仅是因为长度减少了(32 位与 128 位和 160 位相比).但是,如果您只想检查存储的字符串是否已损坏,那么使用 CRC32 就可以了.

                But you should be aware that CRC32 will have more collisions than MD5 or even SHA-1 hashes, simply because of the reduced length (32 bits compared to 128 bits respectively 160 bits). But if you just want to check whether a stored string is corrupted, you'll be fine with CRC32.

                这篇关于非加密用途的最快哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:为什么 crypt/blowfish 使用两种不同的盐生成相同的 下一篇:openssl_digest vs hash vs hash_hmac?SALT 和 SALT 的区别HM

                相关文章

                最新文章

              • <i id='ixgZl'><tr id='ixgZl'><dt id='ixgZl'><q id='ixgZl'><span id='ixgZl'><b id='ixgZl'><form id='ixgZl'><ins id='ixgZl'></ins><ul id='ixgZl'></ul><sub id='ixgZl'></sub></form><legend id='ixgZl'></legend><bdo id='ixgZl'><pre id='ixgZl'><center id='ixgZl'></center></pre></bdo></b><th id='ixgZl'></th></span></q></dt></tr></i><div id='ixgZl'><tfoot id='ixgZl'></tfoot><dl id='ixgZl'><fieldset id='ixgZl'></fieldset></dl></div>
                  <bdo id='ixgZl'></bdo><ul id='ixgZl'></ul>

                <tfoot id='ixgZl'></tfoot>

                <small id='ixgZl'></small><noframes id='ixgZl'>

                <legend id='ixgZl'><style id='ixgZl'><dir id='ixgZl'><q id='ixgZl'></q></dir></style></legend>