summaryrefslogtreecommitdiffstats
path: root/cmd/hashpw/hashpw.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-09-24 17:25:46 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-09-24 17:25:46 -0700
commit35469f25cd53707b3e801caaff49121926bb7238 (patch)
tree6eb1eef980a9f430410101fbf2de3d891ca99324 /cmd/hashpw/hashpw.go
parentTweak defaultIterations for tanjiro (diff)
downloadroseh.moe-35469f25cd53707b3e801caaff49121926bb7238.tar.zst
Rename cmd -> tools
Diffstat (limited to 'cmd/hashpw/hashpw.go')
-rw-r--r--cmd/hashpw/hashpw.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/cmd/hashpw/hashpw.go b/cmd/hashpw/hashpw.go
deleted file mode 100644
index 5bc740d..0000000
--- a/cmd/hashpw/hashpw.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package main
-
-import (
- "crypto/rand"
- "fmt"
- "os"
-
- "gitlab.com/rhogenson/roseh.moe/internal/pwhash"
- "golang.org/x/term"
-)
-
-func run() error {
- fmt.Print("Enter password:")
- password, err := term.ReadPassword(int(os.Stdin.Fd()))
- fmt.Println()
- if err != nil {
- return err
- }
- salt := make([]byte, pwhash.SaltLen)
- rand.Read(salt)
- _, hashedPassword, err := pwhash.Hash(string(password), salt)
- if err != nil {
- return err
- }
- fmt.Printf("notepad-password=%x%x\n", salt, hashedPassword)
- return nil
-}
-
-func main() {
- if err := run(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}