You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
275 B

  1. package keccak256
  2. import (
  3. "golang.org/x/crypto/sha3"
  4. )
  5. // Hash generates a Keccak256 hash from a byte array
  6. func Hash(data ...[]byte) []byte {
  7. hash := sha3.NewLegacyKeccak256()
  8. for _, d := range data {
  9. hash.Write(d) //nolint:errcheck,gosec
  10. }
  11. return hash.Sum(nil)
  12. }