Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

⭐️ 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

βš–οΈ License

The MIT License License: MIT