Last active
April 29, 2022 02:59
-
-
Save coffeegoddd/9b1acb07baaa72c8173a2e7b11dacb80 to your computer and use it in GitHub Desktop.
DoltLab `gentokenenckey`
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
package main | |
import ( | |
crand "crypto/rand" | |
"encoding/base32" | |
"fmt" | |
"io" | |
) | |
func main() { | |
r := make([]byte, 32) | |
_, err := io.ReadFull(crand.Reader, r) | |
if err != nil { | |
panic(err.Error()) | |
} | |
fmt.Printf("%v\n", base32.NewEncoding("0123456789abcdefghijklmnopqrstuv").WithPadding(base32.NoPadding).EncodeToString(r)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment