func BenchmarkBLAKE256(b *testing.B) { val := make([]byte, 1024) for i := 0; i < b.N; i++ { xaxa := blake256.New() xaxa.Write(val) xaxa.Sum(nil) } }
// HashFuncH calculates hash(b) and returns the resulting bytes as a Hash. func HashFuncH(b []byte) Hash { var outB [blake256.Size]byte a := blake256.New() a.Write(b) out := a.Sum(nil) for i, el := range out { outB[i] = el } return Hash(outB) }
// HashFunc calculates the hash of the supplied bytes. // TODO(jcv) Should modify blake256 so it has the same interface as blake2 // and fastsha256 so these function can look more like btcsuite. Then should // try to get it to the upstream blake256 repo func HashFunc(data []byte) [blake256.Size]byte { var outB [blake256.Size]byte a := blake256.New() a.Write(data) out := a.Sum(nil) for i, el := range out { outB[i] = el } return outB }
// HashFuncB calculates hash(b) and returns the resulting bytes. func HashFuncB(b []byte) []byte { a := blake256.New() a.Write(b) out := a.Sum(nil) return out }