Golang encoding/base32.Encoding.EncodeToString function example
package encoding/base32
EncodeToString returns the base32 encoding of the given input source.
Golang encoding/base32.Encoding.EncodeToString function usage example
hash := sha1.New()
hash.Write([]byte("abcd"))
var simpleSubdomainSafeEncoding = base32.NewEncoding("0123456789abcdefghijklmnopqrstuv")
sha := simpleSubdomainSafeEncoding.EncodeToString(hash.Sum(nil))
Reference :
http://golang.org/pkg/encoding/base32/#Encoding.EncodeToString
Advertisement
Something interesting
Tutorials
+9.3k Golang : Temperatures conversion example
+11.6k SSL : The certificate is not trusted because no issuer chain was provided
+6.5k Golang : Spell checking with ispell example
+5.6k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+6.1k nginx : force all pages to be SSL
+12.6k Golang : flag provided but not defined error
+24.5k Golang : How to validate URL the right way
+6.4k PHP : Proper way to get UTF-8 character or string length
+5.8k Unix/Linux : How to test user agents blocked successfully ?
+16.8k Golang : Get own process identifier
+8.4k Your page has meta tags in the body instead of the head
+9.3k Golang : How to get garbage collection data?