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

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

        return deferred.promise;
    }
function generateHash(data) {
        var deferred = Q.defer();

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

        return deferred.promise;
    }
function generateHash ( data ) { var deferred = Q . defer ( ) ; bcrypt . hash ( data , 10 , function ( err , res ) { err ? deferred . reject ( err ) : deferred . resolve ( res ) ; } ) ; return deferred . promise ; }
Generate hash off some data
@param data
Generate hash off some data