github.com/chain5j/chain5j-pkg@v1.0.7/crypto/hashalg/hash.go (about) 1 // Package hashalg 2 // 3 // @author: xwc1125 4 package hashalg 5 6 import ( 7 "crypto/sha256" 8 ) 9 10 // Sha256 sha256 11 func Sha256(data []byte) []byte { 12 h := sha256.New() 13 h.Write(data) 14 return h.Sum(nil) 15 }