@bafode87/iut-encrypt
v1.0.1
Published
module basé sur crypto
Downloads
2
Readme
IUT-ENCRYPT
Module basé sur crypto
Installation
npm i @bafode87/iut-encrypt
Utilisation
Lister des algorithmes que le module peut crypter
const Encrypt = require('@bafode87/iut-encrypt');
Encrypt.algorithms // string => sha1
// sm3
// ...
Crypter un mot de passe et le comparer
const Encrypt = require('@bafode87/iut-encrypt');
const password = 'password';
const hashPassword = Encrypt.sha1(password);
Encrypt.compareSha1(password, hashPassword) // true
Encrypt.compareSha1('wrong password', hashPassword) // false