From b848a268d33ea08176c01332f3419bba20f9e851 Mon Sep 17 00:00:00 2001 From: markau Date: Thu, 9 Jan 2014 10:49:50 +1030 Subject: [PATCH] This simply implements resolution to issue #11 as raised and debugged by dcodeIO. Improves bcrypt-nodejs compatability with the bcrypt package --- bCrypt.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bCrypt.js b/bCrypt.js index 87ad4c6..c243c84 100644 --- a/bCrypt.js +++ b/bCrypt.js @@ -617,9 +617,10 @@ function hash(data, salt, progress, callback) { error - First parameter to the callback detailing any errors. encrypted - Second parameter to the callback providing the encrypted form. */ - if(!callback) { - throw "No callback function was given." - } + if(typeof callback == 'undefined') { + callback = progress; + progress = null; + } process.nextTick(function() { var result = null; var error = null;