docs: record auth hash alignment and validation results

This commit is contained in:
Gabriel20xx committed 2026-10-20 15:26:58 +00:00
1 parent 22887fef03
commit f7819904b9
51 files changed
+1792 -542

No files matched your search

+4 -1
View File
@@ -18,8 +18,11 @@ func TestVerifyTOTPRFC6238SHA1Vectors(t *testing.T) {
{unix: 2000000000, code: "279037"},
}
for _, testCase := range cases {
if !VerifyTOTP(secret, testCase.code, time.Unix(testCase.unix, 0)) {
step, valid := VerifyTOTP(secret, testCase.code, time.Unix(testCase.unix, 0))
if !valid {
t.Errorf("VerifyTOTP(%d, %q) = false", testCase.unix, testCase.code)
} else if want := testCase.unix / int64(TOTPPeriod/time.Second); step != want {
t.Errorf("VerifyTOTP(%d, %q) matched step %d, want %d", testCase.unix, testCase.code, step, want)
}
}
}