将MD5值压缩成8位32进制生成8位长度的唯一英文数字组合字符串

function str16to32($a){
    for($a = md5( $a, true ),
        $s = '0123456789ABCDEFGHIJKLMNOPQRSTUV',
        $d = '',
        $f = 0;
        $f < 8;
        $g = ord( $a[ $f ] ),
        $d .= $s[ ( $g ^ ord( $a[ $f + 8 ] ) ) - $g & 0x1F ],
        $f++
    );
    return $d;
}

 

转载于:https://www.cnblogs.com/whlives/p/9685726.html

    原文作者:weixin_30332241
    原文地址: https://blog.csdn.net/weixin_30332241/article/details/98433571
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞