测试文档md5.php:
<?php
function do_hash($pwd){
$salt ='lkdfl124g5dstg'; //自己随便输入盐值
return md5($pwd.$salt);
}
$char="myblog"; //验证使用$salt_pwd = do_hash($_POST['password'])
$md5_char = md5($char);
$salt_char = do_hash($char); //调用
echo "md5-char is: $md5_char;;;;;;";
echo "salt-char is: $salt_char";
?>
原文:
http://www.jb51.net/article/98261.htm
http://www.cnblogs.com/Venom/p/5484218.html