cbergoon / merkletree

A Merkle Tree implementation written in Go.
MIT License
495 stars 125 forks source link

Support keccak256 ? #21

Closed msebilly closed 1 year ago

msebilly commented 2 years ago

Can it support keccak256 with Ethereum smart contracts?

tonyke-bot commented 2 years ago

You can leverage work from "golang.org/x/crypto/sha3"


import "golang.org/x/crypto/sha3"

func main() {
    var leafs []merkletree.Content
    tree, err := merkletree.NewTreeWithHashStrategy(leafs, sha3.NewLegacyKeccak256)
}