@@ -24,16 +24,16 @@ export default class Hash extends Command {
24
24
25
25
// only 2 parameters required HASH_TYPE and INPUT_STRING
26
26
flags . type = Hash . getHashType ( flags ) //by default let it be sha1
27
- flags . string = Hash . getInputString ( flags , args ) // from either -s,-f or args
27
+ args . string = Hash . getInputString ( flags , args ) // from either -s,-f or args
28
28
29
- this . calculateHash ( flags )
29
+ this . calculateHash ( flags , args )
30
30
}
31
31
32
- private calculateHash ( flags : any ) {
32
+ private calculateHash ( flags : any , args : any ) {
33
33
const hashObject = Hash . getHashObject ( flags )
34
34
35
35
if ( hashObject ) {
36
- let hashed : string = hashObject . hex ( flags . string )
36
+ let hashed : string = hashObject . hex ( args . string )
37
37
Logger . success ( this , `[${ flags . type . toUpperCase ( ) } ] ${ hashed } ` )
38
38
} else {
39
39
Logger . error ( this , 'Invalid Or Unsupported hash type' )
@@ -61,7 +61,7 @@ export default class Hash extends Command {
61
61
return flags . type || 'sha1'
62
62
}
63
63
64
- private static getInputString ( flags : any , args :any ) {
64
+ static getInputString ( flags : any , args :any ) {
65
65
// if -s or -f is not passed we will take it from args
66
66
let str = ''
67
67
if ( flags . string ) //if -s given
0 commit comments