βοΈ Please support us by giving a star! Thanks! βοΈ
π Crypt
Crypt is a standard Deno module that it is used to compute the hash of passwords.
π Features
- BCrypt
- SCrypt
π BCrypt
π§ How to use
import * as bcrypt from 'https://deno.land/x/crypt@v0.1.0/bcrypt.ts';
π‘ Usage
π Async
To hash a password (with auto-generated salt):
const hash = await bcrypt.hash('Crypt');
To check a password:
const result = await bcrypt.compare('Crypt', hash);
To hash a password with a manually generated salt:
const salt = await bcrypt.genSalt(8);
const hash = await bcrypt.hash('Crypt', salt);
π Sync
To hash a password (with auto-generated salt):
const hash = bcrypt.hash('Crypt');
To check a password:
const result = bcrypt.compare('Crypt', hash);
To hash a password with a manually generated salt:
const salt = bcrypt.genSaltSync(8);
const hash = bcrypt.hashSync("Crypt", salt);
π Changelog
Details changes for each release are documented in the CHANGELOG.md.
β Issues
If you think any of the Crypt
can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
πͺ Contribution
Weβd love to have your helping hand on contributions to Crypt
by forking and sending a pull request!
Your contributions are heartily β‘ welcome, recognized and appreciated. (βΏβ βΏβ )
How to contribute:
- Open pull request with improvements
- Discuss ideas in issues
- Spread the word
- Reach out with any feedback