This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
moneroutil/keccak.go

21 lines
318 B
Go
Raw Normal View History

2017-04-25 00:19:04 +00:00
package moneroutil
import (
"github.com/ebfe/keccak"
)
func Keccak256(data ...[]byte) (result []byte) {
h := keccak.New256()
for _, b := range data {
h.Write(b)
}
result = h.Sum(nil)
return
}
func Checksum(data ...[]byte) (result []byte) {
keccak256 := Keccak256(data...)
result = keccak256[:4]
return
}