File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1+ bin /bcrypt text eol =lf
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33var path = require ( "path" ) ,
4- bcrypt = require ( path . join ( __dirname , '..' , ' index.js' ) ) ,
5- pkg = require ( path . join ( __dirname , '..' , ' package.json' ) ) ;
4+ bcrypt = require ( "../ index.js" ) ,
5+ pkg = require ( "../ package.json" ) ;
66
77if ( process . argv . length < 3 ) {
8- process . stderr . write ( [ // No dependencies, so we do it from hand.
8+ process . stderr . write ( [
99 "" ,
1010 " |_ _ _ _ |_" ,
11- " |_)(_| \\/|_)|_ v" + pkg [ 'version' ] + " (c) " + pkg [ 'author ' ] ,
11+ " |_)(_| \\/|_)|_.js v" + pkg [ 'version ' ] ,
1212 " / | "
13- ] . join ( '\n' ) + '\n\n' + " Usage: " + path . basename ( process . argv [ 1 ] ) + " <input> [rounds|salt]\n" ) ;
13+ ] . join ( '\n' ) + '\n\n' + " Usage: " + path . basename ( process . argv [ 1 ] ) + " <input> [rounds|salt]\n" ) ;
1414 process . exit ( 1 ) ;
1515} else {
1616 var salt ;
1717 if ( process . argv . length > 3 ) {
1818 salt = process . argv [ 3 ] ;
1919 var rounds = parseInt ( salt , 10 ) ;
20- if ( rounds == salt )
20+ if ( rounds == salt ) {
2121 salt = bcrypt . genSaltSync ( rounds ) ;
22- } else
22+ }
23+ } else {
2324 salt = bcrypt . genSaltSync ( ) ;
24- process . stdout . write ( bcrypt . hashSync ( process . argv [ 2 ] , salt ) + "\n" ) ;
25+ }
26+ process . stdout . write ( bcrypt . hashSync ( process . argv [ 2 ] , salt ) + "\n" ) ;
2527}
You can’t perform that action at this time.
0 commit comments