EncodeToString in Go

Posted by GoDoc
Public (Editable by Users)

EncodeToString returns the hexadecimal encoding of src.

Go
Edit
package main

import (
	"encoding/hex"
	"fmt"
)

func main() {
	src := []byte("Hello")
	encodedStr := hex.EncodeToString(src)

	fmt.Printf("%s\n", encodedStr)
}