Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: switch order of parameters
  • Loading branch information
danbev committed Apr 25, 2018
commit 118a012530d96f4b6f8cf5d17afc87836ac4d207
12 changes: 6 additions & 6 deletions lib/internal/crypto/sig.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Sign.prototype._write = function _write(chunk, encoding, callback) {

Sign.prototype.update = function update(data, encoding) {
encoding = encoding || getDefaultEncoding();
data = checkIsArrayBufferView(toBuf(data, encoding), 'data');
data = checkIsArrayBufferView('data', toBuf(data, encoding));
this._handle.update(data);
return this;
};
Expand Down Expand Up @@ -72,7 +72,7 @@ Sign.prototype.sign = function sign(options, encoding) {
}
}

key = checkIsArrayBufferView(toBuf(key), 'key');
key = checkIsArrayBufferView('key', toBuf(key));

var ret = this._handle.sign(key, passphrase, rsaPadding, pssSaltLength);

Expand Down Expand Up @@ -123,10 +123,10 @@ Verify.prototype.verify = function verify(options, signature, sigEncoding) {
}
}

key = checkIsArrayBufferView(toBuf(key), 'key');
key = checkIsArrayBufferView('key', toBuf(key));

signature = checkIsArrayBufferView(toBuf(signature, sigEncoding),
'signature');
signature = checkIsArrayBufferView('signature',
toBuf(signature, sigEncoding));

return this._handle.verify(key, signature, rsaPadding, pssSaltLength);
};
Expand All @@ -136,7 +136,7 @@ module.exports = {
Verify
};

function checkIsArrayBufferView(buffer, name) {
function checkIsArrayBufferView(name, buffer) {
if (!isArrayBufferView(buffer)) {
throw new ERR_INVALID_ARG_TYPE(
name,
Expand Down