Golang encoding/base32.NewEncoding function examples
package encoding/base32
NewEncoding returns a new Encoding defined by the given alphabet, which must be a 32-byte string.
Golang encoding/base32.NewEncoding function usage examples
Example 1 :
var simpleSubdomainSafeEncoding = base32.NewEncoding("0123456789abcdefghijklmnopqrstuv")
Example 2 :
const encodeStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
const encodeHex = "0123456789ABCDEFGHIJKLMNOPQRSTUV"
// StdEncoding is the standard base32 encoding, as defined in
// RFC 4648.
var StdEncoding = NewEncoding(encodeStd)
// HexEncoding is the ``Extended Hex Alphabet'' defined in RFC 4648.
// It is typically used in DNS.
var HexEncoding = NewEncoding(encodeHex)
References :
Advertisement
Something interesting
Tutorials
+8.2k Golang : HttpRouter multiplexer routing example
+10.1k Golang : Edge detection with Sobel method
+28.5k Golang : Change a file last modified date and time
+15.9k Golang : Update database with GORM example
+13.4k Golang : Get constant name from value
+7.4k Linux : How to fix Brother HL-1110 printing blank page problem
+18.7k Golang : convert int to string
+27.7k PHP : Count number of JSON items/objects
+11.7k Golang : Find age or leap age from date of birth example
+6.3k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+9k Golang : Go as a script or running go with shebang/hashbang style
+9.2k nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)