tests/bytes2hex/main.go

19 lines
387 B
Go

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))
}