diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-05-05 21:20:22 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-05-05 21:20:22 -0600 |
commit | eed10ce514f28e4acf772f76c92ca05eebec105f (patch) | |
tree | d76820d7a3cd23f09f7dd0e6065bb0cef7ba16dc /srv/src/cmd/userid-calc-cli | |
parent | cc8b6289ac3f7d1abb648217949beb89827d7374 (diff) |
Fix various problems with the srv build
Diffstat (limited to 'srv/src/cmd/userid-calc-cli')
-rw-r--r-- | srv/src/cmd/userid-calc-cli/main.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/srv/src/cmd/userid-calc-cli/main.go b/srv/src/cmd/userid-calc-cli/main.go new file mode 100644 index 0000000..90c44e7 --- /dev/null +++ b/srv/src/cmd/userid-calc-cli/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + + "github.com/mediocregopher/blog.mediocregopher.com/srv/chat" +) + +func main() { + + secret := flag.String("secret", "", "Secret to use when calculating UserIDs") + name := flag.String("name", "", "") + password := flag.String("password", "", "") + + flag.Parse() + + calc := chat.NewUserIDCalculator([]byte(*secret)) + userID := calc.Calculate(*name, *password) + + b, err := json.Marshal(userID) + if err != nil { + panic(err) + } + + fmt.Println(string(b)) +} |