package main
import (
b64 "encoding/base64"
"fmt"
)
func main() {
//base64编码
str1 := b64.StdEncoding.EncodeToString([]byte("www.02405.com"))
fmt.Println(str1)
//base64解码
bytes, _ := b64.StdEncoding.DecodeString("d3d3LjAyNDA1LmNvbQ==")
str2 := string(bytes)
fmt.Println(str2)
}
输出:
d3d3LjAyNDA1LmNvbQ== www.02405.com