@jfromaniello/bcrypt-cli
v1.0.0
Published
A command line utility for hashing and comparing passwords using bcrypt.
Downloads
3
Readme
A command line utility for hashing and comparing passwords using bcrypt.
Install
npm i -g @jfromaniello/bcrypt-cli
Usage
» bcrypt <cmd> [args]
Commands:
bcrypt compare [password] [hash] Compare a password to a hash
bcrypt hash [password] Hash a password and return the result
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
Example:
» bcrypt hash super-duper-duper
The hash is $2b$10$ZAwDHekJ2gzqjnd/luQoS.MVbxq11.T3FT69sH0QXJ/yuspqxMLRu
» HASH=$(bcrypt hash super-duper-duper)
» echo $HASH
$2b$10$ZAwDHekJ2gzqjnd/luQoS.MVbxq11.T3FT69sH0QXJ/yuspqxMLRu
» bcrypt compare super-duper-duper $HASH
The password match.
» bcrypt compare another-password $HASH
The password does not match.
$ echo $?
1
You can also use - to provide the input through the standard input:
» echo -n foobar | bcrypt hash | bcrypt compare foobar -
The password match.
License
MIT 2019 - José F. Romaniello