summaryrefslogtreecommitdiff
path: root/lib/crypto.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-11-22 16:59:48 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2014-11-22 17:23:30 +0100
commit21130c7d6fcaee666f33735768c060be2e06614a (patch)
tree0148a92dd9e6fb13ab6fac3311bd96d926f313fc /lib/crypto.js
parent963f5e8a886841d69e79fdc46aaa0010126408e8 (diff)
downloadnode-new-21130c7d6fcaee666f33735768c060be2e06614a.tar.gz
lib: turn on strict mode
Turn on strict mode for the files in the lib/ directory. It helps catch bugs and can have a positive effect on performance. PR-URL: https://github.com/node-forward/node/pull/64 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'lib/crypto.js')
-rw-r--r--lib/crypto.js6
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);