Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript scrypt.js失败,N大于2^14_Javascript_Hash_Cryptography_Scrypt - Fatal编程技术网

Javascript scrypt.js失败,N大于2^14

Javascript scrypt.js失败,N大于2^14,javascript,hash,cryptography,scrypt,Javascript,Hash,Cryptography,Scrypt,这很有效 var scrypt = scrypt_module_factory(); var pwh=scrypt.crypto_scrypt(scrypt.encode_utf8("pleaseletmein"), scrypt.encode_utf8("SodiumChloride"), Math.pow(2,14), 8, 1, 224); 这失败了 var scrypt = scrypt_module_factory(); var pwh

这很有效

var scrypt = scrypt_module_factory();
var pwh=scrypt.crypto_scrypt(scrypt.encode_utf8("pleaseletmein"),
            scrypt.encode_utf8("SodiumChloride"),
            Math.pow(2,14), 8, 1, 224);
这失败了

var scrypt = scrypt_module_factory();
var pwh=scrypt.crypto_scrypt(scrypt.encode_utf8("pleaseletmein"),
            scrypt.encode_utf8("SodiumChloride"),
            Math.pow(2,15), 8, 1, 224);
区别在于N参数是2^15而不是2^14

有什么想法吗

Firebug控制台中的故障如下所示

uncaught exception: abort() at 
wa@http://localhost/keybase/javascript/scrypt.js:10126:9      
ua@http://localhost/keybase/javascript/scrypt.js:132:9 
nc@http://localhost/keybase/javascript/scrypt.js:1266:9 
bL@http://localhost/keybase/javascript/scrypt.js:4164:33    
bu@http://localhost/keybase/javascript/scrypt.js:2168:33  
crypto_scrypt@http://localhost/keybase/javascript/scrypt.js:10263:1  
get_salt/<.success@http://localhost/keybase/javascript/main.js:91:1  
jQuery.Callbacks/fire@http://code.jquery.com/jquery-latest.js:3119:1  
jQuery.Callbacks/self.fireWith@http://code.jquery.com/jquery- 
latest.js:3231:7 
done@http://code.jquery.com/jquery-latest.js:9275:67 
.send/callback@http://code.jquery.com/jquery-latest.js:9685:8   
.send@http://code.jquery.com/jquery-latest.js:9691:7   
.ajax@http://code.jquery.com/jquery-latest.js:9176:5  
get_salt@http://localhost/keybase/javascript/main.js:95:9  
@http://localhost/keybase/javascript/main.js:58:9  
jQuery.event.dispatch@http://code.jquery.com/jquery-latest.js:4641:1  
jQuery.event.add/elemData.handle@http://code.jquery.com/jquery-
latest.js:4309:1
未捕获异常:在
wa@http://localhost/keybase/javascript/scrypt.js:10126:9
ua@http://localhost/keybase/javascript/scrypt.js:132:9
nc@http://localhost/keybase/javascript/scrypt.js:1266:9
bL@http://localhost/keybase/javascript/scrypt.js:4164:33
bu@http://localhost/keybase/javascript/scrypt.js:2168:33
加密_scrypt@http://localhost/keybase/javascript/scrypt.js:10263:1
拿盐/

解决了这个问题。感谢上面的安东·萨姆索诺夫。这是一个记忆问题。无参数初始化默认为32mb。如上所述初始化将内存使用率设置为64mb。

这是一个-是的,与Tony中的代码相同。它如何失败?错误消息是什么?请将此添加到GitHub问题中。GitHub的问题链接:您是否确定了32768和65536之间发生故障的确切点?在运行/重新启动时总是相同还是不同?
 var scrypt = scrypt_module_factory(67108864);