barrysteyn / node-scrypt

Scrypt for Node
369 stars 88 forks source link

Bugfix for params arg ordering of `maxmem` and `maxmemfrac` to match documentation #165

Open shanewholloway opened 6 years ago

shanewholloway commented 6 years ago

Documentation lists the argument order of scrypt.paramsSync and scrypt.params as maxtime, [maxmem, [max_memfrac]], and the argument checking in index.js is consistent with this. However, both src/node-boilerplate/inc/scrypt_params_async.h and src/node-boilerplate/scrypt_params_sync.cc were accessing the arguments as [maxtime, max_memfrac, maxmem], and thus returning incorrect results.