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

cli_hash

v3.1.2

Published

CLI tool wrapping [bcryptjs](https://www.npmjs.com/package/bcryptjs) that generates a salted hash from input file or compares input file with provided hash. When generating the hash you can select the number of rounds to generate the hash salt. When compa

Downloads

5

Readme

CLI Hash

CLI tool wrapping bcryptjs that generates a salted hash from input file or compares input file with provided hash. When generating the hash you can select the number of rounds to generate the hash salt. When comparing instead of the salt rounds introduce the file containing the hash.

Useful for testing if you bcryptjs in your project and for comparing strings and hashes (sensitive data) without sharing them with online tools.

Install

With npm installed type:

npm install --global cli_hash

Execute:

To hash:

cli_hash generate -i <path-to-file> [-s <salt-generation-rounds>] [-o <path-to-output-file>]

To compare:

cli_hash compare -i <path-to-file> -c <path-to-file-containing-hash>

Examples

The repository contains test files under test/ that you can use to check the behavior.

1. Generate hash from string
cli_hash generate -i test/string-to-hash.txt -s 12

Hashes string contained in test/string-to-hash.txt using 12 rounds to generate the hashing salt. The generated hash will be printed in the console. This is equivalent to

cli_hash generate -i test/string-to-hash.txt -s 12

since 12 is the default value for salt length.

If you want to store the hash in a file instead of printing it to console you can do that specifying the output file with -o

cli_hash generate -i test/string-to-hash.txt -o test/output_hash.txt
2. Compare string to hash
cli_hash compare -i test/string-to-hash.txt -c test/hash-to-check.txt

Checks string contained in test/string-to-hash.txt matches hash contained in test/hash-to-check.txt. The hashes should match and ✔ String and hash match will be printed in the console.

Check for negative comparison with

cli_hash compare -i test/wrong-string-to-hash.txt -c test/hash-to-check.txt

✘ String and hash do NOT match will be printed in the console.

Build Documentation (JSDoc)

npm run generate_docs

The html documentation will be exported to /docs.

CLI Hash Generator uses bcryptjs.