summaryrefslogtreecommitdiffstats
path: root/tools/hashpw/hashpw.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hashpw/hashpw.go')
-rw-r--r--tools/hashpw/hashpw.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/hashpw/hashpw.go b/tools/hashpw/hashpw.go
index 5bc740d..7705b31 100644
--- a/tools/hashpw/hashpw.go
+++ b/tools/hashpw/hashpw.go
@@ -1,11 +1,10 @@
package main
import (
- "crypto/rand"
"fmt"
"os"
- "gitlab.com/rhogenson/roseh.moe/internal/pwhash"
+ "gitlab.com/rhogenson/roseh.moe/internal/cryptoutil"
"golang.org/x/term"
)
@@ -16,13 +15,11 @@ func run() error {
if err != nil {
return err
}
- salt := make([]byte, pwhash.SaltLen)
- rand.Read(salt)
- _, hashedPassword, err := pwhash.Hash(string(password), salt)
+ hashedPassword, err := cryptoutil.Hash(string(password))
if err != nil {
return err
}
- fmt.Printf("notepad-password=%x%x\n", salt, hashedPassword)
+ fmt.Printf("notepad-password=%s\n", hashedPassword)
return nil
}