The example below shows to how to and then subsequently a string using . We use the encoding/64 package to do this, which takes in and returns a byte array into it’s encode and decode methods.
package main import ( "encoding/base64" "fmt" ) func main() { myString := "This is testing base 64!" // Encode encodedString := base64.StdEncoding.EncodeToString([]byte(myString)) fmt.Printf("Encoded: %sn", encodedString) // Decode raw, err := base64.

Source link


Please enter your comment!
Please enter your name here