summaryrefslogtreecommitdiff
path: root/pwned.go
diff options
context:
space:
mode:
Diffstat (limited to 'pwned.go')
-rw-r--r--pwned.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pwned.go b/pwned.go
index a965c4d..c6083b8 100644
--- a/pwned.go
+++ b/pwned.go
@@ -29,11 +29,11 @@ func NewPWDB(fn string) (*pwdb, error) {
return nil, err
}
- const rs = 63 // V2 has fixed width of 63 bytes
+ const hash_length = 40 // sha1 is 40 chars
+ const rs = hash_length + 1 // sha1 + newline
if stat.Size()%rs != 0 {
- return nil, fmt.Errorf("Unexpected password file format (must be a text file with 63 char width starting with sha1)")
+ return nil, fmt.Errorf("Unexpected password file format (must be a text file with only sha1 + newline)")
}
- const hash_length = 40 // sha1 is 40 chars
return &pwdb{f, int(stat.Size() / rs), rs, hash_length}, nil
}