Skip to content

Commit

Permalink
Correct help/readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pepa65 committed Oct 18, 2024
1 parent 4627531 commit d0dea5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# becrypt
**Generate and check bcrypt hashes from a CLI**

* Version: 1.4.0
* Version: 1.4.1
* License: [MIT](LICENSE)
* Repo: `github.com/pepa65/becrypt`
* Modified interface from `github.com/shoenig/bcrypt-tool`:
Expand All @@ -16,16 +16,17 @@

## Usage
```
becrypt v1.4.0 - Generate and check bcrypt hashes from a CLI
becrypt v1.4.1 - Generate and check bcrypt hashes from a CLI
Repo: github.com/pepa65/becrypt
Usage: becrypt OPTION
Options:
help|-h|--help Display this HELP text.
cost|-c|--cost <hash> Display the COST of bcrypt <hash>.
<hash> [-q|--quiet] ^ CHECK the password against bcrypt <hash>.
[<cost>] ^ Generate a HASH from the given password
(optional <cost>: 4..31, default: 10).
^ Password: can be piped-in or prompted for; it's cut off after 72 characters.
<hash> [-q|--quiet] CHECK the password(^) against bcrypt <hash>.
[<cost>] Generate a HASH from the given password(^).
(Optional <cost>: 4..31, default: 10.)
(^) Password: can be piped-in or prompted for, it gets cut off after 72 bytes.
Longer ones are accepted without warning, using only the first 72 bytes!
```

## Install from Releases
Expand Down
16 changes: 9 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
version = "1.4.0"
version = "1.4.1"
pwMaxLen = 72
)

Expand All @@ -30,13 +30,15 @@ Usage: ` + self + ` OPTION
Options:
help|-h|--help Display this HELP text.
cost|-c|--cost <hash> Display the COST of bcrypt <hash>.
<hash> [-q|--quiet] CHECK the password against bcrypt <hash>.
[<cost>] Generate a HASH from the given password
(optional <cost>: ` +
<hash> [-q|--quiet] CHECK the password(^) against bcrypt <hash>.
[<cost>] Generate a HASH from the given password(^).
(Optional <cost>: ` +
strconv.Itoa(bcrypt.MinCost) + ".." + strconv.Itoa(bcrypt.MaxCost) +
", default: " + strconv.Itoa(bcrypt.DefaultCost) + `)
The password can be piped-in or prompted for. It's cut off after ` +
strconv.Itoa(pwMaxLen) + " characters."
", default: " + strconv.Itoa(bcrypt.DefaultCost) + `.)
(^) Password: can be piped-in or prompted for, it gets cut off after ` +
strconv.Itoa(pwMaxLen) + ` bytes.
Longer ones are accepted without warning, using only the first ` +
strconv.Itoa(pwMaxLen) + " bytes!";
fmt.Fprintln(os.Stderr, helptxt)
if msg != "" {
fmt.Fprintln(os.Stderr, "Abort: "+msg)
Expand Down

0 comments on commit d0dea5e

Please sign in to comment.