我需要使用salt加密密码,它必须是UTF 16。
这就是我现在所拥有的,但他们告诉我它的UTF-8
$key = 'dfs7dsfsdf';
$timestamp = '201705111500';
$concat = $key . $timestamp;
$hash = hash('sha256', $concat);
答案 0 :(得分:2)
试试这个
$key = 'dfs7dsfsdf';
$timestamp = '201705111500';
$concat = $key . $timestamp;
$cString = mb_convert_encoding($total, "UTF-16LE");
$hash = hash('sha256', $cString);
你忘记了
$cString = mb_convert_encoding($total, "UTF-16LE");