TypechoJoeTheme

Dcr163的博客

统计

微擎密码加密方式

2017-02-21
/
0 评论
/
798 阅读
/
正在检测是否收录...
02/21
/*生成salt */
function random($length, $numeric = FALSE) {
    $seed = base_convert(md5(microtime() . $_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
    $seed = $numeric ? (str_replace('0', '', $seed) . '012340567890') : ($seed . 'zZ' . strtoupper($seed));
    if ($numeric) {
        $hash = '';
    } else {
        $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64);
        $length--;
    }
    $max = strlen($seed) - 1;
    for ($i = 0; $i < $length; $i++) {
        $hash .= $seed{mt_rand(0, $max)};
    }
    return $hash;
}

/*生成微擎密码*/
$passwordinput = "{$data['password']}-{$data['salt']}-{$_W['config']['setting']['authkey']}";

$newPwd=sha1($passwordinput);

这个newPwd 就是微擎用户加密的方式


朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

http://dcr163.cn/112.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. slot mpo terbaru
    2025-02-08
  2. Sherry Stockdill
    2025-01-28
  3. slot demo
    2025-01-13
  4. 陌天
    2025-01-09
  5. Kerrie Bostick
    2024-12-28

标签云