summaryrefslogtreecommitdiff
path: root/lib/crypto.js
diff options
context:
space:
mode:
authorsolebox <solekiller@gmail.com>2016-10-09 20:00:13 +0300
committerAnna Henningsen <anna@addaleax.net>2016-10-15 21:11:49 +0200
commit6f05de4d89f8af2f6c0e84b6d1f7460bc5ebc116 (patch)
tree6cbffb5ba073f663160d11dfd3e485cc804781e0 /lib/crypto.js
parent113c697ded9d6dfd1e24ced5d290fe6c7af4e9fb (diff)
downloadandroid-node-v8-6f05de4d89f8af2f6c0e84b6d1f7460bc5ebc116.tar.gz
android-node-v8-6f05de4d89f8af2f6c0e84b6d1f7460bc5ebc116.tar.bz2
android-node-v8-6f05de4d89f8af2f6c0e84b6d1f7460bc5ebc116.zip
crypto: naming anonymous functions
Ref: https://github.com/nodejs/node/issues/8913 PR-URL: https://github.com/nodejs/node/pull/8993 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/crypto.js')
-rw-r--r--lib/crypto.js50
1 files changed, 26 insertions, 24 deletions
diff --git a/lib/crypto.js b/lib/crypto.js
index aa5a7d0cc9..33de8a0bae 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -59,24 +59,24 @@ function Hash(algorithm, options) {
util.inherits(Hash, LazyTransform);
-Hash.prototype._transform = function(chunk, encoding, callback) {
+Hash.prototype._transform = function _transform(chunk, encoding, callback) {
this._handle.update(chunk, encoding);
callback();
};
-Hash.prototype._flush = function(callback) {
+Hash.prototype._flush = function _flush(callback) {
this.push(this._handle.digest());
callback();
};
-Hash.prototype.update = function(data, encoding) {
+Hash.prototype.update = function update(data, encoding) {
encoding = encoding || exports.DEFAULT_ENCODING;
this._handle.update(data, encoding);
return this;
};
-Hash.prototype.digest = function(outputEncoding) {
+Hash.prototype.digest = function digest(outputEncoding) {
outputEncoding = outputEncoding || exports.DEFAULT_ENCODING;
return this._handle.digest(outputEncoding);
};
@@ -122,12 +122,12 @@ function Cipher(cipher, password, options) {
util.inherits(Cipher, LazyTransform);
-Cipher.prototype._transform = function(chunk, encoding, callback) {
+Cipher.prototype._transform = function _transform(chunk, encoding, callback) {
this.push(this._handle.update(chunk, encoding));
callback();
};
-Cipher.prototype._flush = function(callback) {
+Cipher.prototype._flush = function _flush(callback) {
try {
this.push(this._handle.final());
} catch (e) {
@@ -137,7 +137,7 @@ Cipher.prototype._flush = function(callback) {
callback();
};
-Cipher.prototype.update = function(data, inputEncoding, outputEncoding) {
+Cipher.prototype.update = function update(data, inputEncoding, outputEncoding) {
inputEncoding = inputEncoding || exports.DEFAULT_ENCODING;
outputEncoding = outputEncoding || exports.DEFAULT_ENCODING;
@@ -152,7 +152,7 @@ Cipher.prototype.update = function(data, inputEncoding, outputEncoding) {
};
-Cipher.prototype.final = function(outputEncoding) {
+Cipher.prototype.final = function final(outputEncoding) {
outputEncoding = outputEncoding || exports.DEFAULT_ENCODING;
var ret = this._handle.final();
@@ -165,21 +165,21 @@ Cipher.prototype.final = function(outputEncoding) {
};
-Cipher.prototype.setAutoPadding = function(ap) {
+Cipher.prototype.setAutoPadding = function setAutoPadding(ap) {
this._handle.setAutoPadding(ap);
return this;
};
-Cipher.prototype.getAuthTag = function() {
+Cipher.prototype.getAuthTag = function getAuthTag() {
return this._handle.getAuthTag();
};
-Cipher.prototype.setAuthTag = function(tagbuf) {
+Cipher.prototype.setAuthTag = function setAuthTag(tagbuf) {
this._handle.setAuthTag(tagbuf);
};
-Cipher.prototype.setAAD = function(aadbuf) {
+Cipher.prototype.setAAD = function setAAD(aadbuf) {
this._handle.setAAD(aadbuf);
};
@@ -267,14 +267,14 @@ function Sign(algorithm, options) {
util.inherits(Sign, stream.Writable);
-Sign.prototype._write = function(chunk, encoding, callback) {
+Sign.prototype._write = function _write(chunk, encoding, callback) {
this._handle.update(chunk, encoding);
callback();
};
Sign.prototype.update = Hash.prototype.update;
-Sign.prototype.sign = function(options, encoding) {
+Sign.prototype.sign = function sign(options, encoding) {
if (!options)
throw new Error('No key provided to sign');
@@ -306,7 +306,7 @@ util.inherits(Verify, stream.Writable);
Verify.prototype._write = Sign.prototype._write;
Verify.prototype.update = Sign.prototype.update;
-Verify.prototype.verify = function(object, signature, sigEncoding) {
+Verify.prototype.verify = function verify(object, signature, sigEncoding) {
sigEncoding = sigEncoding || exports.DEFAULT_ENCODING;
return this._handle.verify(toBuf(object), toBuf(signature, sigEncoding));
};
@@ -474,14 +474,14 @@ function dhGetPrivateKey(encoding) {
}
-DiffieHellman.prototype.setPublicKey = function(key, encoding) {
+DiffieHellman.prototype.setPublicKey = function setPublicKey(key, encoding) {
encoding = encoding || exports.DEFAULT_ENCODING;
this._handle.setPublicKey(toBuf(key, encoding));
return this;
};
-DiffieHellman.prototype.setPrivateKey = function(key, encoding) {
+DiffieHellman.prototype.setPrivateKey = function setPrivateKey(key, encoding) {
encoding = encoding || exports.DEFAULT_ENCODING;
this._handle.setPrivateKey(toBuf(key, encoding));
return this;
@@ -599,19 +599,21 @@ function Certificate() {
}
-Certificate.prototype.verifySpkac = function(object) {
+Certificate.prototype.verifySpkac = function verifySpkac(object) {
return binding.certVerifySpkac(object);
};
-Certificate.prototype.exportPublicKey = function(object, encoding) {
- return binding.certExportPublicKey(toBuf(object, encoding));
-};
+Certificate.prototype.exportPublicKey =
+ function exportPublicKey(object, encoding) {
+ return binding.certExportPublicKey(toBuf(object, encoding));
+ };
-Certificate.prototype.exportChallenge = function(object, encoding) {
- return binding.certExportChallenge(toBuf(object, encoding));
-};
+Certificate.prototype.exportChallenge =
+ function exportChallenge(object, encoding) {
+ return binding.certExportChallenge(toBuf(object, encoding));
+ };
exports.setEngine = function setEngine(id, flags) {