Golang encoding/base64.Encoding.Encode function example
package encoding/base64
Encode encodes src(2nd parameter) using the encoding enc, writing EncodedLen(len(src)) bytes to dst(1st parameter) The encoding pads the output to a multiple of 4 bytes, so Encode is not appropriate for use on individual blocks of a large data stream. Use NewEncoder() instead.
Golang encoding/base64.Encoding.Encode function usage example
digest := hash.Sum(nil)
mac := make([]byte, base64.URLEncoding.EncodedLen(len(digest)))
base64.URLEncoding.Encode(mac, digest)
Reference :
Advertisement
Something interesting
Tutorials
+8.3k Golang : Implementing class(object-oriented programming style)
+10.4k Golang : cannot assign type int to value (type uint8) in range error
+15.2k Golang : How to check if IP address is in range
+5.4k Python : Delay with time.sleep() function example
+10.6k Golang : Get local time and equivalent time in different time zone
+7.2k Golang : Dealing with postal or zip code example
+29.1k Golang : Get first few and last few characters from string
+20.9k Golang : Convert PNG transparent background image to JPG or JPEG image
+17.2k Google Chrome : Your connection to website is encrypted with obsolete cryptography
+7k Golang : How to call function inside template with template.FuncMap
+7.9k Setting $GOPATH environment variable for Unix/Linux and Windows
+29.9k Golang : Get and Set User-Agent examples