我想制作一个链接到社交引擎数据库的其他注册页面,但是当我对密码进行MD5并将其存储在se_users表中时,用户无法登录,我相信社交引擎有另一种加密方法,可以有人请给我一个功能来加密社交引擎方式的密码?
这是他们的功能,但我不知道如何在我的脚本中实现它:
function user_password_crypt($user_password)
{
global $setting;
if( !$this->user_exists )
{
$method = $setting['setting_password_method'];
$this->user_salt = randomcode($setting['setting_password_code_length']);
}
else
{
$method = $this->user_info['user_password_method'];
}
// For new methods
if( $method>0 )
{
if( !empty($this->user_salt) )
{
list($salt1, $salt2) = str_split($this->user_salt, ceil(strlen($this->user_salt) / 2));
$salty_password = $salt1.$user_password.$salt2;
}
else
{
$salty_password = $user_password;
}
}
$user_password_crypt = md5($salty_password);
return $user_password_crypt;
}
Run Code Online (Sandbox Code Playgroud)
谢谢