mirror of
https://github.com/status-im/nim-codex.git
synced 2025-01-10 10:55:48 +00:00
05a7f47113
This is a storage engine based on IPFS, which is only a part of Dagger
11 lines
235 B
Nim
11 lines
235 B
Nim
import pkg/libp2p
|
|
|
|
type
|
|
MerkleDag* = object
|
|
data*: seq[byte]
|
|
|
|
proc rootId*(dag: MerkleDag): Cid =
|
|
let codec = multiCodec("dag-pb")
|
|
let hash = MultiHash.digest("sha2-256", dag.data).get()
|
|
Cid.init(CIDv0, codec, hash).get()
|