Created
May 7, 2019 12:01
-
-
Save cyantarek/68f00d11285864a499e6f57ececd6afc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// genKey generates 256 random bytes | |
func genKey() string { | |
token := make([]byte, 8) | |
// error checking ommiting for the | |
// sake of this tutorial | |
// but you SHOULD not avoid it in production | |
_, _ = rand.Read(token) | |
return hex.EncodeToString(token) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment