diff options
Diffstat (limited to 'lib/crypto.js')
-rw-r--r-- | lib/crypto.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/crypto.js b/lib/crypto.js index 2f0a00b152..91106b35f6 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -22,6 +22,8 @@ // Note: In 0.8 and before, crypto functions all defaulted to using // binary-encoded strings rather than buffers. +'use strict'; + exports.DEFAULT_ENCODING = 'buffer'; try { @@ -600,11 +602,11 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) { // at this point, we need to handle encodings. var encoding = exports.DEFAULT_ENCODING; if (callback) { - function next(er, ret) { + var next = function(er, ret) { if (ret) ret = ret.toString(encoding); callback(er, ret); - } + }; binding.PBKDF2(password, salt, iterations, keylen, digest, next); } else { var ret = binding.PBKDF2(password, salt, iterations, keylen, digest); |