by jossctz · 8y ago · 0 comments
func benchmarkHash(b *testing.B, h hash.Hash) {
data := make([]byte, 1024)
rand.Read(data)
b.ResetTimer()
b.SetBytes(len(data))
for n := 0; n < b.N; n++ {
h.Write(data)
h.Sum(nil)
}
}No comments yet.