From d0dea5e9781b2ab3ae6bec6986722852e6779aa5 Mon Sep 17 00:00:00 2001 From: "gitlab.com/pepa65" Date: Fri, 18 Oct 2024 09:53:51 +0700 Subject: [PATCH] Correct help/readme --- README.md | 13 +++++++------ main.go | 16 +++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e112fee..ccf046c 100644 --- a/README.md +++ b/README.md @@ -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`: @@ -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 Display the COST of bcrypt . - [-q|--quiet] ^ CHECK the password against bcrypt . - [] ^ Generate a HASH from the given password - (optional : 4..31, default: 10). -^ Password: can be piped-in or prompted for; it's cut off after 72 characters. + [-q|--quiet] CHECK the password(^) against bcrypt . + [] Generate a HASH from the given password(^). + (Optional : 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 diff --git a/main.go b/main.go index a239d4a..ecf8630 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( ) const ( - version = "1.4.0" + version = "1.4.1" pwMaxLen = 72 ) @@ -30,13 +30,15 @@ Usage: ` + self + ` OPTION Options: help|-h|--help Display this HELP text. cost|-c|--cost Display the COST of bcrypt . - [-q|--quiet] CHECK the password against bcrypt . - [] Generate a HASH from the given password - (optional : ` + + [-q|--quiet] CHECK the password(^) against bcrypt . + [] Generate a HASH from the given password(^). + (Optional : ` + 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)