2017-08-29 123 views
0
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 

我只知道,问题就来了在开始的数据类型,所以它会产生不同的结果。 我需要开始产生相同的结果,而不声明(43ec3e5dee6e706af7766fffea512721)

+2

第一个值'begin'包含一些不可打印的字符,因为你得到不同的结果。 – alexmac

回答

1

你是因为你使用两种不同的字符串得到不同的结果:\\075\075

+0

如何转换。 \\ 075到\ 075? @destoryer – Juvenal