function separateMd5(begin,end) {
console.log("Begin: "+begin);
// The variable begin, when encrypted, shows me the incorrect encryption
console.log('With function hexMD5 begin: (Incorrect)');
var encrypted = md5.hexMD5(begin);
console.log(encrypted);
// The correct encryption should be this:
console.log("Declare begin and use function hexMD5 (Correct):")
begin='\075';
var encrypted = md5.hexMD5(begin);
console.log(encrypted);
}
输出
Begin: \075
With function hexMD5 begin: (Incorrect)
27790613e018862f3b5b92b8d4f48f44
Declare begin and use function hexMD5 (Correct):
43ec3e5dee6e706af7766fffea512721
我只知道问题出在begin的数据类型上,所以它会产生不同的结果。 我需要开始生成相同的结果而不被声明(43ec3e5dee6e706af7766fffea512721)
最佳答案
您会得到不同的结果,因为您使用了两个不同的字符串:\\075
和 \075
。
关于javascript - 创建正确的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45942800/