summaryrefslogtreecommitdiff
path: root/srv/src/cmd/hash-password
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/cmd/hash-password')
-rw-r--r--srv/src/cmd/hash-password/main.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/srv/src/cmd/hash-password/main.go b/srv/src/cmd/hash-password/main.go
new file mode 100644
index 0000000..b787a4d
--- /dev/null
+++ b/srv/src/cmd/hash-password/main.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "bufio"
+ "fmt"
+ "os"
+ "strings"
+
+ "github.com/mediocregopher/blog.mediocregopher.com/srv/api"
+)
+
+func main() {
+
+ fmt.Fprint(os.Stderr, "Password: ")
+
+ line, err := bufio.NewReader(os.Stdin).ReadString('\n')
+
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Println(api.NewPasswordHash(strings.TrimSpace(line)))
+}