npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

password-toolbox

v1.1.4

Published

A simple toolkit for generate, analyse and hash passwords with Node.js.

Downloads

7

Readme

Password toolkit

Password toolkit is a simple library that will help you handling passwords with Node.js without any dependencies. You can use this library to generate suggested passwords, analyse user provided passwords in order to get a strength score and create a hash that can be stored within the database.

Password analysis

Simple analysis:

passwordToolBox.analyzer.analyze(password);

Complete analysis (async with Promise support):

passwordToolBox.analyzer.setDictionaryPath('rockyou.txt').completeAnalysis(password).then(function(analysis){}).catch(function(error){});

Note that the complete analysis require a dictionary containing a list of weak passwords, passwords in this list must be separated by a break line (\n). You can download dictionaries here. Both methods will return an object containing informations about chars count, keywords and the score.

Password generation

Random password:

passwordToolBox.generator.generate(12);

Human readable password generation (async with Promise support):

passwordToolBox.generator.setDictionaryPath('dictionary.txt').generateHumanReadable(12).then(function(password){}).catch(function(error){});

Note that in order to generate human readable passwords you need a dictionary, words in the dictionary must be separated by a break line (\n). If you are looking for an English word list, give a look here.

Password hashing

Simple hash generation:

passwordToolBox.hash.createSimpleHash(password);

More complex hash generation:

passwordToolBox.hash.createHash(password);

The first method will return the hash as a string, the second one will return an object with the hash and its parameters (salts, algorithm, loop number). If you need to compare a given password and a hash generated with the first method you can use this method:

passwordToolBox.hash.compareSimpleHash(password, hash);

While if you used the second method you can do this:

passwordToolBox.hash.compareHash(password, hash);

Are you looking for the PHP version? Give a look here.