2808 explained code solutions for 75 technologies


golangEncode value to base64


package main
import (
  b64 "encoding/base64"
  "fmt"
)

func main() {
  str := b64.StdEncoding.EncodeToString([]byte("Hi"))
}ctrl + c
b64 "encoding/base64"

load module to work with base64

b64.StdEncoding.EncodeToString

encodes given bytes into base64 string

[]byte

convert given string to bytes

"Hi"

sample string to encode into base64