{"size": 464, "ext": "js", "max_stars_repo_path": "app/utils/secureHash.js", "max_stars_repo_name": "KaiserPhemi/logan", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/utils/secureHash.js", "max_issues_repo_name": "KaiserPhemi/logan", "max_issues_repo_issues_event_min_datetime": "2020-04-24T22:52:30.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-18T08:55:15.000Z", "max_forks_repo_path": "app/utils/secureHash.js", "max_forks_repo_name": "KaiserPhemi/logan", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 18, "max_forks_count": null, "avg_line_length": 17.8461538462, "max_line_length": 48, "alphanum_fraction": 0.6314655172}
// libraries
const bcrypt = require("bcrypt");
const saltRounds = 10;

/**
 * @desc
 */
module.exports = {
  /**
   * @desc hashes a password
   * @param {string} plainPwd
   */
  hashPassword(password) {
    return bcrypt.hash(password, saltRounds);
  },

  /**
   * @desc checks for password match
   * @param {string} password
   * @param {string} storedHash
   */
  checkPassword(password, storedHash) {
    return bcrypt.compare(password, storedHash);
  }
};
