github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/model/hash/hash.go (about)

     1  package hash
     2  
     3  import (
     4  	"github.com/onflow/crypto/hash"
     5  )
     6  
     7  // DefaultComputeHash is the default hasher used by Flow.
     8  //
     9  // `ComputeSHA3_256` can be used directly
    10  // to minimize heap allocations
    11  func DefaultComputeHash(data []byte) hash.Hash {
    12  	var res [hash.HashLenSHA3_256]byte
    13  	hash.ComputeSHA3_256(&res, data)
    14  	return hash.Hash(res[:])
    15  }