package main import ( "encoding/base64" "encoding/hex" "fmt" "log" ) func main() { input := "bRMrS29FKvSoH4jexlhIumahHLw=" hx, err := base64.StdEncoding.DecodeString(input) hxStr := hex.EncodeToString(hx) if err != nil { log.Fatal("sdgre") } fmt.Printf("From bytestring \"%s\" with length %d\r\nget hexstring \"%s\" with length %d", input, len(input), hxStr, len(hxStr)) }