We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6f3bd16 + 6662fb7 commit ed1c3a9Copy full SHA for ed1c3a9
cmd/README.md
@@ -0,0 +1,6 @@
1
+
2
+To run the hasher, do like this
3
4
+```bash
5
+$ go run hasher.go hunter2
6
+```
cmd/hasher.go
@@ -0,0 +1,18 @@
+package main
+import (
+ "fmt"
+ "os"
7
+ "golang.org/x/crypto/bcrypt"
8
+)
9
10
+func main() {
11
+ password := os.Args[1]
12
13
+ hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
14
+ if err != nil {
15
+ fmt.Println("Error generating hash: %s", err)
16
+ }
17
+ fmt.Println(string(hash))
18
+}
0 commit comments