Skip to content

Instantly share code, notes, and snippets.

@joshsmith
Created January 6, 2012 19:26
Show Gist options
  • Save joshsmith/1572007 to your computer and use it in GitHub Desktop.
Save joshsmith/1572007 to your computer and use it in GitHub Desktop.
company.js
var Company = function() {
this.crypto = require('ezcrypto').Crypto;
}
// Create the company
Company.prototype.create = function (name, contact, email, password) {
result = this.hashPassword(password);
if (err) {
return callback(err);
}
return callback(null, result);
}
// Get company with just their email address
Company.prototype.hashPassword = function (password, callback) {
if(typeof password !== 'string') {
var err = 'Not a string.'
} else {
var result = {
password: this.crypto.SHA256(password)
};
}
if (err) {
return callback(err);
}
return callback(null, result);
}
module.exports = Company;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment