forked from mtusi2026/mtusi2026lab7
17 lines
283 B
Go
17 lines
283 B
Go
package password
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func BenchmarkDefaultHash(b *testing.B) {
|
|
h := NewHasher(Default, 1)
|
|
b.ReportAllocs()
|
|
for i := 0; i < b.N; i++ {
|
|
if _, err := h.Hash(context.Background(), "synthetic-benchmark-password"); err != nil {
|
|
b.Fatal(err)
|
|
}
|
|
}
|
|
}
|