Created
April 16, 2019 02:55
-
-
Save sle-c/e53fab6c788cfcb04db8f13c00917049 to your computer and use it in GitHub Desktop.
Command to generate a random 32 bits key and print to the screen
This file contains hidden or 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 cmd | |
import ( | |
"fmt" | |
"github.com/omnisyle/goliauth" | |
"github.com/spf13/cobra" | |
) | |
func keyCmd() *cobra.Command { | |
command := &cobra.Command{ | |
Use: "key", | |
Short: "Generate a 32 bit random key", | |
Run: func(cmd *cobra.Command, args []string) { | |
fmt.Printf("%x\n", goliauth.NewRandomKey()) | |
}, | |
} | |
return command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment