Home >php教程 >php手册 >计算文本的各种Hash加密,超级全面

计算文本的各种Hash加密,超级全面

WBOY
WBOYOriginal
2016-06-06 19:39:231175browse

DEMO演示:http://dighash.com/ 全站代码:https://github.com/hustcc/dig_hash,求star hash算法包括:md2,md4,md5,sha1,sha224,sha256,sha384,sha512,ripemd128,ripemd160,ripemd256,ripemd320,whirlpool,tiger128_3,tiger160_3,tiger192_3,tiger128_4,tig

DEMO演示:http://dighash.com/

全站代码:https://github.com/hustcc/dig_hash ,求star

hash算法 包括:md2,md4,md5,sha1,sha224,sha256,sha384,sha512,ripemd128,ripemd160,ripemd256,ripemd320,whirlpool,tiger128_3,tiger160_3,tiger192_3,tiger128_4,tiger160_4,tiger192_4,snefru,snefru256,gost,gost-crypto,adler32,crc32,crc32b,fnv132,fnv1a32,fnv164,fnv1a64,joaat,haval128_3,haval160_3,haval192_3,haval224_3,haval256_3,haval128_4,haval160_4,haval192_4,haval224_4,haval256_4,haval128_5,haval160_5,haval192_5,haval224_5,haval256_5

看晕了吧,直接看上面的demo网址吧!

function cal_hash($chars) {
    $algos = hash_algos();
    $hash_rst = array();
    foreach($algos as $algo) {
        $st = microtime();
        $rst = hash($algo, $chars, false);
        $et = microtime();
        list($ss, $si) = explode(' ', $st);
        list($es, $ei) = explode(' ', $et);
        $hash_rst[str_replace(",", "_", $algo)] = array('rst' => $rst, 'time' => $ei + $es - $si - $ss);
    }
    return $hash_rst;
}

计算文本的各种Hash加密,超级全面

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn