2021-01-12 12:43:23 +00:00
|
|
|
import pkg/libp2p/multihash
|
|
|
|
|
|
|
|
export multihash
|
|
|
|
|
2021-01-12 10:48:26 +00:00
|
|
|
type
|
|
|
|
MerkleDag* = object
|
|
|
|
data*: seq[byte]
|
2021-01-12 12:43:23 +00:00
|
|
|
|
|
|
|
proc rootHash*(dag: MerkleDag): MultiHash =
|
|
|
|
MultiHash.digest("sha2-256", dag.data).get()
|