summaryrefslogtreecommitdiff
path: root/lib/crypto.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-07-26 14:38:08 -0700
committerisaacs <i@izs.me>2013-08-01 15:08:01 -0700
commit22c68fdc1dae40f0ed9c71a02f66e5b2c6353691 (patch)
treeb6d14cad6f5a9ba78172f77c5c2ec10b8a6cb89c /lib/crypto.js
parent9a29aa8c552eb2b120c101c1cfd66ba565a17ed5 (diff)
downloadandroid-node-v8-22c68fdc1dae40f0ed9c71a02f66e5b2c6353691.tar.gz
android-node-v8-22c68fdc1dae40f0ed9c71a02f66e5b2c6353691.tar.bz2
android-node-v8-22c68fdc1dae40f0ed9c71a02f66e5b2c6353691.zip
src: Replace macros with util functions
Diffstat (limited to 'lib/crypto.js')
-rw-r--r--lib/crypto.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/crypto.js b/lib/crypto.js
index c450f1c15f..9cfc09e3c0 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -43,7 +43,7 @@ var util = require('util');
// to break them unnecessarily.
function toBuf(str, encoding) {
encoding = encoding || 'binary';
- if (IS_STRING(str)) {
+ if (util.isString(str)) {
if (encoding === 'buffer')
encoding = 'binary';
str = new Buffer(str, encoding);
@@ -100,7 +100,7 @@ exports.createCredentials = function(options, context) {
if (options.ciphers) c.context.setCiphers(options.ciphers);
if (options.ca) {
- if (IS_ARRAY(options.ca)) {
+ if (util.isArray(options.ca)) {
for (var i = 0, len = options.ca.length; i < len; i++) {
c.context.addCACert(options.ca[i]);
}
@@ -112,7 +112,7 @@ exports.createCredentials = function(options, context) {
}
if (options.crl) {
- if (IS_ARRAY(options.crl)) {
+ if (util.isArray(options.crl)) {
for (var i = 0, len = options.crl.length; i < len; i++) {
c.context.addCRL(options.crl[i]);
}
@@ -198,7 +198,7 @@ Hash.prototype._flush = function(callback) {
Hash.prototype.update = function(data, encoding) {
encoding = encoding || exports.DEFAULT_ENCODING;
- if (encoding === 'buffer' && IS_STRING(data))
+ if (encoding === 'buffer' && util.isString(data))
encoding = 'binary';
this._binding.update(data, encoding);
return this;
@@ -539,7 +539,7 @@ DiffieHellman.prototype.setPrivateKey = function(key, encoding) {
exports.pbkdf2 = function(password, salt, iterations, keylen, callback) {
- if (!IS_FUNCTION(callback))
+ if (!util.isFunction(callback))
throw new Error('No callback provided to pbkdf2');
return pbkdf2(password, salt, iterations, keylen, callback);