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
+21.7k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+9.4k Golang : Qt Yes No and Quit message box example
+8.9k Golang : What is the default port number for connecting to MySQL/MariaDB database ?
+9.4k Facebook : Getting the friends list with PHP return JSON format
+36k Golang : Get file last modified date and time
+17.3k Golang : How to tell if a file is compressed either gzip or zip ?
+5k Golang : Constant and variable names in native language
+6k Golang : Function as an argument type example
+4.9k Unix/Linux : secure copying between servers with SCP command examples
+10.1k Golang : How to get quoted string into another string?
+6.1k PageSpeed : Clear or flush cache on web server
+19.3k Golang : Get host name or domain name from IP address