Skip to content

Commit 00f53f0

Browse files
committed
feat: add benchmark for check password
1 parent 9012294 commit 00f53f0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

infrastructure/hash/hash_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,13 @@ func BenchmarkHashPassword(b *testing.B) {
114114
_, _ = HashPassword(password)
115115
}
116116
}
117+
118+
func BenchmarkCheckPassword(b *testing.B) {
119+
password := random.RandomString(12)
120+
hashStr, _ := HashPassword(password)
121+
b.ResetTimer()
122+
123+
for i := 0; i < b.N; i++ {
124+
_, _ = CheckPassword(password, hashStr)
125+
}
126+
}

0 commit comments

Comments
 (0)