Golang encoding/base64.Encoding.DecodeString function examples
package encoding/base64
DecodeString returns the bytes represented by the given input base64 string s.
Golang encoding/base64.Encoding.DecodeString function usage examples
Example 1 :
auth, err := base64.URLEncoding.DecodeString(req.Header.Get("X-Registry-Auth"))
if err != nil {
fmt.Printf("Error decoding auth. %#v", err.Error())
}
Example 2 :
s = "abc"
b, err := base64.StdEncoding.DecodeString(s[1])
if err != nil {
return ""
}
References :
http://golang.org/pkg/encoding/base64/#Encoding.DecodeString
https://www.socketloop.com/references/golang-encoding-base32-encoding-decodestring-function-examples
Advertisement
Something interesting
Tutorials
+8.1k Golang : Append and add item in slice
+17.7k Golang : Read data from config file and assign to variables
+12.5k Golang : Arithmetic operation with numerical slices or arrays example
+14.3k Golang : Recombine chunked files example
+7.8k Golang : Regular Expression find string example
+14.6k Golang : Reset buffer example
+8.8k Android Studio : Image button and button example
+6k Golang : Convert Chinese UTF8 characters to Pin Yin
+8.9k Golang : Gaussian blur on image and camera video feed examples
+7.7k Golang : Test if an input is an Armstrong number example
+6.2k Golang : Extract XML attribute data with attr field tag example
+7.9k Javascript : Put image into Chrome browser's console