func doTheHash(buf []byte, b *testing.B) { hash := ripemd160.New() for i := 0; i < b.N; i++ { hash.Reset() hash.Write(buf) res = hash.Sum(nil) } }
func init() { hashPool = NewPool(512) hashPool.New = func(params ...interface{}) interface{} { return ripemd160.New() } keyBufPool = NewPool(512) keyBufPool.New = func(params ...interface{}) interface{} { return new(bytes.Buffer) } }