fix: incorrect binary value convert (#279)
This commit is contained in:
parent
6eeb701439
commit
88e2c6cb43
|
@ -24,7 +24,7 @@ func (BinaryConvert) Encode(str string) (string, bool) {
|
|||
|
||||
func (BinaryConvert) Decode(str string) (string, bool) {
|
||||
var binary strings.Builder
|
||||
for _, char := range str {
|
||||
for _, char := range []byte(str) {
|
||||
binary.WriteString(fmt.Sprintf("%08b", int(char)))
|
||||
}
|
||||
return binary.String(), true
|
||||
|
|
Loading…
Reference in New Issue