Javascript 创建正确的数据类型

Javascript 创建正确的数据类型,javascript,node.js,Javascript,Node.js,输出 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);

输出

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的数据类型中,因此它会生成不同的结果。
我需要在不声明的情况下开始生成相同的结果(43ec3e5dee6e706af7766fffea512721)

您得到的结果不同,因为您使用了两个不同的字符串:
\\075
\075
第一个值
begin
包含一些无法打印的字符,因此,你会得到不同的结果。如何转换\\075到\075@破坏者
Begin: \075
With function hexMD5 begin: (Incorrect)
27790613e018862f3b5b92b8d4f48f44
Declare begin and use function hexMD5 (Correct):
43ec3e5dee6e706af7766fffea512721