Skip to content

Instantly share code, notes, and snippets.

@coffeegoddd
Last active April 29, 2022 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coffeegoddd/9b1acb07baaa72c8173a2e7b11dacb80 to your computer and use it in GitHub Desktop.
Save coffeegoddd/9b1acb07baaa72c8173a2e7b11dacb80 to your computer and use it in GitHub Desktop.
DoltLab `gentokenenckey`
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