Compare commits
3 Commits
f3768373f8
...
v0.3.1
Author | SHA1 | Date | |
---|---|---|---|
8657f3c13d | |||
93954add96 | |||
5793a18358 |
@ -3,7 +3,7 @@ type: docker
|
|||||||
name: main
|
name: main
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- tag
|
event: tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-windows
|
- name: build-windows
|
||||||
@ -25,7 +25,7 @@ steps:
|
|||||||
- build-windows
|
- build-windows
|
||||||
- build-linux
|
- build-linux
|
||||||
settings:
|
settings:
|
||||||
base_url: 'https://git.jfmonty2.com/jfmonty2/passphrase.git'
|
base_url: 'https://git.jfmonty2.com'
|
||||||
files:
|
files:
|
||||||
- passphrase_linux
|
- passphrase_linux
|
||||||
- passphrase.exe
|
- passphrase.exe
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
author = "Joseph Montanaro"
|
author = "Joseph Montanaro"
|
||||||
description = "Passphrase generator and dictionary builder"
|
description = "Passphrase generator and dictionary builder"
|
||||||
license = "none"
|
license = "none"
|
||||||
|
@ -33,9 +33,6 @@ const dict = loadWords()
|
|||||||
|
|
||||||
|
|
||||||
proc genPassphrase(length, dictSize: int): string =
|
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)
|
var rands = newSeq[uint64](length)
|
||||||
discard randomBytes(rands)
|
discard randomBytes(rands)
|
||||||
|
|
||||||
@ -65,7 +62,7 @@ proc parseInput(): (int, int) =
|
|||||||
try:
|
try:
|
||||||
length = parseInt(params[0])
|
length = parseInt(params[0])
|
||||||
except ValueError:
|
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:
|
if params.len > 1:
|
||||||
try:
|
try:
|
||||||
@ -73,7 +70,7 @@ proc parseInput(): (int, int) =
|
|||||||
if dictSize < 100 or dictSize > dict.len:
|
if dictSize < 100 or dictSize > dict.len:
|
||||||
quit("Dictionary size must be between 100 and " & $dict.len, 1)
|
quit("Dictionary size must be between 100 and " & $dict.len, 1)
|
||||||
except ValueError:
|
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)
|
result = (length, dictSize)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user