Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Blake3 | 3,836 | 145 | 4 days ago | 25 | January 25, 2022 | 99 | other | Assembly | ||
the official Rust and C implementations of the BLAKE3 cryptographic hash function | ||||||||||
Jssha | 2,157 | 1,657 | 380 | 2 months ago | 20 | December 07, 2020 | 2 | bsd-3-clause | TypeScript | |
A JavaScript/TypeScript implementation of the complete Secure Hash Standard (SHA) family (SHA-1, SHA-224/256/384/512, SHA3-224/256/384/512, SHAKE128/256, cSHAKE128/256, and KMAC128/256) with HMAC. | ||||||||||
Imagehash | 1,878 | 30 | 2 | 13 days ago | 14 | November 29, 2021 | 32 | mit | PHP | |
🌄 Perceptual image hashing for PHP | ||||||||||
Openhashtab | 1,766 | 2 months ago | 49 | gpl-3.0 | C++ | |||||
📝 File hashing and checking shell extension | ||||||||||
Libchaos | 1,628 | 3 years ago | 1 | February 27, 2018 | 3 | other | C++ | |||
Advanced library for randomization, hashing and statistical analysis (devoted to chaos machines). :microscope: | ||||||||||
Deepdiff | 1,611 | 408 | 224 | 4 days ago | 63 | April 10, 2022 | 59 | other | Python | |
DeepDiff: Deep Difference and search of any Python object/data. DeepHash: Hash of any object based on its contents. Delta: Use deltas to reconstruct objects by adding deltas together. | ||||||||||
Cryptopasta | 1,509 | 123 | 68 | 4 years ago | October 03, 2021 | 11 | other | Go | ||
copy & paste-friendly golang crypto | ||||||||||
Robin Hood Hashing | 1,283 | 2 months ago | 17 | mit | C++ | |||||
Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 | ||||||||||
Object Hash | 1,257 | 179,549 | 1,468 | 11 days ago | 47 | February 18, 2022 | 35 | mit | JavaScript | |
Generate hashes from javascript objects in node and the browser. | ||||||||||
Name That Hash | 1,214 | 2 months ago | 6 | gpl-3.0 | Python | |||||
🔗 Don't know what type of hash it is? Name That Hash will name that hash type! 🤖 Identify MD5, SHA256 and 300+ other hashes ☄ Comes with a neat web app 🔥 |
password-hash is a node.js library to simplify use of hashed passwords.
Storing passwords in plain-text is bad. This library makes the storing of passwords (and subsequent validation of) hashed passwords a bit easier.
password-hash provides functions for generating a hashed passwords and verifying a plain-text password against a hashed password. For a bit of added strength, a random salt is generated when the password is hashed. The hashed password contains both the cryptographic algorithm that was used as well the salt, so all that is needed to verify a plain-text password is the hashed password itself.
npm install password-hash
Generates a hash of the required password
argument. Hashing behavior can be modified with the optional options
object:
algorithm
- A valid cryptographic algorithm for use with the crypto.createHmac
function, defaults to 'sha1'.saltLength
- The length of the salt that will be generated when the password is hashed, defaults to 8.iterations
- The number of times the hashing algorithm should be applied, defaults to 1.Errors are thrown if:
password
is not a stringoptions.algorithm
is specified but not a valid cryptographic algorithmoptions.saltLength
is specified but not a positive integerThe hashed password will be in the format algorithm$salt$hash
.
Example:
var passwordHash = require('password-hash'); var hashedPassword = passwordHash.generate('password123'); console.log(hashedPassword); // sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97
Compares a plain-text password (password
) to a hashed password (hashedPassword
) and returns a boolean. Both arguments are required.
Example:
var passwordHash = require('./lib/password-hash'); var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97'; console.log(passwordHash.verify('password123', hashedPassword)); // true console.log(passwordHash.verify('Password0', hashedPassword)); // false
Check if a password (password
) is hashed. Returns a boolean.
Example:
var passwordHash = require('./lib/password-hash'); var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97'; console.log(passwordHash.isHashed('password123')); // false console.log(passwordHash.isHashed(hashedPassword)); // true
node 0.5.8 introduced crypto.randomBytes
, which generates cryptographically strong pseudo-random data. If the version of node supports crypto.randomBytes
it is used to generate the salt, otherwise Math.random
, which is not cryptographically strong, is used. This is handled transparently within the salt generation function and does not impact the module's API.
password-hash is inspired by the password hashing found in Werkzeug.