package main
import (
"encoding/base32"
"fmt"
"os"
"strings"
)
func main() {
input := os.Args[1]
inputnospace := strings.Replace(input, " ", "", -1)
inputnospaceupper := strings.ToUpper(inputnospace)
key, err := base32.StdEncoding.DecodeString(inputnospaceupper)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(key)
}
image.png
错误提示包含指定索引位置,在网上找到了如下答案,只支持A-Z,2-7,=
Your problem is that that input data isn't Base32 encoded. Base32 encoding only uses the characters A-Z (capital only), 2-7, and =
网友评论