github.com/aergoio/aergo@v1.3.1/internal/common/hash.go (about)

     1  package common
     2  
     3  import (
     4  	sha256 "github.com/minio/sha256-simd"
     5  )
     6  
     7  // Hasher exports default hash function for trie
     8  var Hasher = func(data ...[]byte) []byte {
     9  	hasher := sha256.New()
    10  	for i := 0; i < len(data); i++ {
    11  		hasher.Write(data[i])
    12  	}
    13  	return hasher.Sum(nil)
    14  }