mirror of
https://github.com/arnaucube/go-iden3-crypto.git
synced 2026-02-07 11:36:41 +01:00
15 lines
275 B
Go
15 lines
275 B
Go
package keccak256
|
|
|
|
import (
|
|
"golang.org/x/crypto/sha3"
|
|
)
|
|
|
|
// Hash generates a Keccak256 hash from a byte array
|
|
func Hash(data ...[]byte) []byte {
|
|
hash := sha3.NewLegacyKeccak256()
|
|
for _, d := range data {
|
|
hash.Write(d) //nolint:errcheck,gosec
|
|
}
|
|
return hash.Sum(nil)
|
|
}
|