Golang encoding/base32.Encoding.Encode function example
package encoding/base32
Encode encodes input source (2nd parameter) using the selected encoding, writing EncodedLen(len(src)) bytes to destination (1st parameter). The encoding pads the output to a multiple of 8 bytes, so Encode is not appropriate for use on individual blocks of a large data stream. Use NewEncoder() instead.
Golang encoding/base32.Encoding.Encode function usage example
func unpackBase32(b []byte) string {
b32 := make([]byte, base32.HexEncoding.EncodedLen(len(b)))
base32.HexEncoding.Encode(b32, b) // <---- Encode
return string(b32)
}
Reference :
Advertisement
Something interesting
Tutorials
+8.2k Golang : Find relative luminance or color brightness
+4.8k Golang : A program that contain another program and executes it during run-time
+9.2k nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
+23.9k Golang : Fix type interface{} has no field or no methods and type assertions example
+9.7k PHP : Get coordinates latitude/longitude from string
+18.6k Golang : Find IP address from string
+13.7k Golang : Image to ASCII art example
+11.6k Golang : Concurrency and goroutine example
+8.1k Golang : Variadic function arguments sanity check example
+6.3k Golang : How to get capacity of a slice or array?
+12.3k Golang : Validate email address
+10.9k Golang : Removes punctuation or defined delimiter from the user's input