Skip to content

Commit ed1c3a9

Browse files
committed
Merge branch 'master' of github.com:decke/smtprelay
2 parents 6f3bd16 + 6662fb7 commit ed1c3a9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

cmd/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -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

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
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

Comments
 (0)