File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -67,20 +67,24 @@ func validateHexEntropyFlagInput(str string) error {
67
67
68
68
// Check if string contain hex or binary prefix and return string without it
69
69
func checkInputPrefix (str string ) (string , error ) {
70
- if len (str ) > 2 {
71
- switch str [0 :2 ] {
72
- case "0x" :
70
+ if hex && len (str ) > 2 {
71
+ if str [0 :2 ] == "0x" {
73
72
if err := validateHexEntropyFlagInput (str [2 :]); err != nil {
74
73
return "" , err
75
74
}
76
75
return strings .TrimSpace (str [2 :]), nil
77
- case "0b" :
76
+ }
77
+ }
78
+ if ! hex && len (str ) > 2 {
79
+ if str [0 :2 ] == "0b" {
78
80
if err := validateEntropyFlagInput (str [2 :]); err != nil {
79
81
return "" , err
80
82
}
81
83
return strings .TrimSpace (str [2 :]), nil
82
84
}
85
+
83
86
}
87
+
84
88
return str , nil
85
89
}
86
90
func processSHA256 () error {
You can’t perform that action at this time.
0 commit comments