UNPKG

mst-server-common2

Version:
1 lines 374 B
const s=require("bcrypt"),a=11,e=async(a,e)=>{try{return await s.compare(a,e)}catch(s){return console.log(s.stack),!1}},t=async e=>{const t={status:!0,encPassword:"",password:e,message:""};try{const c=await s.hash(e,a);t.status=!0,t.message="success",t.encPassword=c}catch(s){t.status=!1,t.message=s.message}return t};module.exports={getEncryptedPassword:t,checkPassword:e};