{"version":3,"sources":["../../../src/utilities/hash.ts"],"sourcesContent":["import * as bcrypt from 'bcryptjs'\n\nimport { Instance } from '../instance'\n\nexport const hash = async (password: string) => {\n\tpassword = password.trim()\n\tif (!password) return ''\n\treturn await bcrypt.hash(password, Instance.get().settings.utils.hashSaltRounds)\n}\n\nexport const compare = async (plainPassword: string, hashed: string) => {\n\tplainPassword = plainPassword.trim()\n\tif (!plainPassword && plainPassword === hashed) return true\n\treturn await bcrypt.compare(plainPassword, hashed)\n}\n"],"mappings":"AAAA,UAAYA,MAAY,WAExB,OAAS,YAAAC,MAAgB,cAElB,MAAMC,EAAO,MAAOC,IAC1BA,EAAWA,EAAS,KAAK,EACpBA,EACE,MAAMH,EAAO,KAAKG,EAAUF,EAAS,IAAI,EAAE,SAAS,MAAM,cAAc,EADzD,IAIVG,EAAU,MAAOC,EAAuBC,KACpDD,EAAgBA,EAAc,KAAK,EAC/B,CAACA,GAAiBA,IAAkBC,EAAe,GAChD,MAAMN,EAAO,QAAQK,EAAeC,CAAM","names":["bcrypt","Instance","hash","password","compare","plainPassword","hashed"]}