Output checksum

This commit is contained in:
Brian Buller 2017-08-17 15:05:19 -05:00
parent 566382e0ad
commit d12486bd81

View File

@ -6,20 +6,22 @@ import (
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
passage "gogs.bullercodeworks.com/brian/passage-go" passage "git.bullercodeworks.com/brian/passage-go"
) )
func main() { func main() {
var pin, door string var pin, door string
p := passage.CreatePassage("")
for i := 1; i < len(os.Args); i++ { for i := 1; i < len(os.Args); i++ {
switch i { switch i {
case 1: case 1:
pin = os.Args[i] pin = os.Args[i]
p.SetPin(pin)
fmt.Println("Checksum: " + p.GetChecksumAsString())
case 2: case 2:
door = os.Args[i] door = os.Args[i]
} }
} }
p := passage.CreatePassage("")
getInput := (pin == "" && door == "") getInput := (pin == "" && door == "")
for getInput { for getInput {
if pin == "" { if pin == "" {