Skip to content

pirxpilot/argon2

 
 

Repository files navigation

NPM version Build Status Dependency Status Financial contributors on Open Collective

@pirxpilot/argon2

This is a fork of node-argon2 that is using crypto.argon2 implementation as described in #469 It can be used with node >= 24.7.0

Usage

It's possible to hash using either Argon2i, Argon2d or Argon2id (default), and verify if a password matches a hash.

To hash a password:

import * as argon2 from '@pirxpilot/argon2';

try {
  const hash = await argon2.hash("password");
} catch (err) {
  //...
}

To verify a password:

try {
  if (await argon2.verify("<big long hash>", "password")) {
    // password match
  } else {
    // password did not match
  }
} catch (err) {
  // internal failure
}

Note

By default, argon2.hash will generate secure hashes according to the security recommendations by the team that develops Argon2. For password hashing, there is no need to modify them.

To see how you can modify the output (hash length, encoding) and parameters (time cost, memory cost and parallelism), read the wiki

Contributors

Code contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

Work licensed under the MIT License. Please check P-H-C/phc-winner-argon2 for license over Argon2 and the reference implementation.

About

Argon2 hashing algorithm

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.1%
  • Makefile 2.9%