7 Commits

Author SHA1 Message Date
dd0852a154 typo
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:58:45 -07:00
6e938d71f7 rename linux executable after building
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:56:34 -07:00
23bac97cea add pointless echo step
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:47:47 -07:00
741d70ea42 try to figure out why linux build isn't running
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:47:12 -07:00
fb72d824d3 first attempt to parallelize build stages
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:46:21 -07:00
203cc55350 add drone CI config
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 16:37:05 -07:00
29e59ab845 more refactoring 2021-07-27 10:41:23 -07:00
3 changed files with 14 additions and 5 deletions

View File

@ -3,7 +3,11 @@ type: docker
name: main
trigger:
event: tag
branch:
- master
event:
- push
- tag
steps:
- name: build-windows
@ -21,11 +25,13 @@ steps:
- name: release
image: plugins/gitea-release
when:
event: tag
depends_on:
- build-windows
- build-linux
settings:
base_url: 'https://git.jfmonty2.com'
base_url: 'https://git.jfmonty2.com/jfmonty2/passphrase.git'
files:
- passphrase_linux
- passphrase.exe

View File

@ -1,6 +1,6 @@
# Package
version = "0.3.1"
version = "0.1.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)