utils/hash.js
function compare(data, encrypted) {
        var deferred = Q.defer();

        bcrypt.compare(data, encrypted, function (err, res) {
            err ? deferred.reject(err) : deferred.resolve(res);
        });

        return deferred.promise;
    }
function compare(data, encrypted) {
        var deferred = Q.defer();

        bcrypt.compare(data, encrypted, function (err, res) {
            err ? deferred.reject(err) : deferred.resolve(res);
        });

        return deferred.promise;
    }
function compare ( data , encrypted ) { var deferred = Q . defer ( ) ; bcrypt . compare ( data , encrypted , function ( err , res ) { err ? deferred . reject ( err ) : deferred . resolve ( res ) ; } ) ; return deferred . promise ; }
Compare some data to an encrypted version
@param data
@param encrypted
Compare some data to an encrypted version