achim-crypto
v1.0.1
Published
it really simple to ecrypt or hash your password
Downloads
17
Readme
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"
Install
>> npm i -S achim-crypto achim-salt
Example
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){
User.create({
username: req.body.username,
password: pass,
secret: secretKey
})
.then(result => res.send(result))
} else {
res.send(`${req.body.username} : allready exist`)
}
})
}