4 Commits

Author SHA1 Message Date
eabe966971 v0.5.0
Some checks failed
continuous-integration/drone/tag Build is failing
2021-07-28 17:48:24 -07:00
ef3139fafd remove unnecessary .git 2021-07-28 17:48:14 -07:00
c342f2d7f3 v0.4.0
Some checks failed
continuous-integration/drone/tag Build is failing
2021-07-28 17:10:39 -07:00
d1c77ac237 fix drone config 2021-07-28 17:08:50 -07:00
3 changed files with 7 additions and 4 deletions

View File

@ -25,7 +25,7 @@ steps:
- build-windows
- build-linux
settings:
base_url: 'https://git.jfmonty2.com'
base_url: 'https://git.jfmonty2.com/jfmonty2/passphrase'
files:
- passphrase_linux
- passphrase.exe

View File

@ -1,6 +1,6 @@
# Package
version = "0.3.1"
version = "0.5.0"
author = "Joseph Montanaro"
description = "Passphrase generator and dictionary builder"
license = "none"

View File

@ -33,6 +33,9 @@ const dict = loadWords()
proc genPassphrase(length, dictSize: int): string =
if dictSize < 100 or dictSize > dict.len:
quit("Dictionary size must be between 100 and " & $dict.len, 1)
var rands = newSeq[uint64](length)
discard randomBytes(rands)
@ -62,7 +65,7 @@ proc parseInput(): (int, int) =
try:
length = parseInt(params[0])
except ValueError:
quit('"' & params[0] & "\" is not a valid passphrase length.", 1)
quit(params[0] & " is not a valid passphrase length.", 1)
if params.len > 1:
try:
@ -70,7 +73,7 @@ proc parseInput(): (int, int) =
if dictSize < 100 or dictSize > dict.len:
quit("Dictionary size must be between 100 and " & $dict.len, 1)
except ValueError:
quit('"' & params[1] & "\" is not a valid dictionary size.", 1)
quit(params[1] & " is not a valid dictionary size.", 1)
result = (length, dictSize)