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
+5k Golang : Calculate a pip value and distance to target profit example
+7.7k Gogland : Where to put source code files in package directory for rookie
+13.1k Golang : Handle or parse date string with Z suffix(RFC3339) example
+6.5k Elasticsearch : Shutdown a local node
+9.7k Golang : interface - when and where to use examples
+6.3k Javascript : Generate random key with specific length
+4.6k Javascript : Detect when console is activated and do something about it
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+14.4k Golang : On enumeration
+41k Golang : How to check if a string contains another sub-string?
+5.4k Golang : Get S3 or CloudFront object or file information