node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


How to use

This package designed to help you to hash or encrypt your password. usually used when user login, register, change password etc. this package also comes with other packages "achim-salt"


>> npm i -S achim-crypto achim-salt


const hash = require('achim-crypto');
const salt = require('achim-salt');

var register = (req, res) => {
  secretKey = salt()
  pass = hash(req.body.password, secretKey)
  User.find({username: req.body.username})
  .then(result => {
    if(result.length == 0){
        username: req.body.username,
        password: pass,
        secret: secretKey
      .then(result => res.send(result))
    } else {
      res.send(`${req.body.username} : allready exist`)