关于js的问题大神求救

var encryptionPassword = $.Encryption.getEncryption('weizai9527','\x00\x00\x00\x00\x42\xd4\x56\xff',code);

这个JS代码是通过 密码 还有第二个不知道什么参数,第三个是验证码然后执行 进行加密。

把第二个值写死是可以的。但是如果定义成变量。

var test='\x00\x00\x00\x00\x42\xd4\x56\xff'; 然后赋值 test 加密出来的东西就不对了。求解,求大神帮助

这个值应该是key吧?

感觉你test作用域有问题吧,调用var encryptionPassword = $.Encryption.getEncryption('weizai9527',test,code);这个代码的作用域内是另外一个test变量,而不是你赋值的var test='\x00\x00\x00\x00\x42\xd4\x56\xff';这个变量,你 console.log看看就知道了,复制给变量在传递给函数没看出什么问题

 console.log(test);//正常应该是����BÔVÿ这个内容
var encryptionPassword = $.Encryption.getEncryption('weizai9527',test,code);