Documentation ¶
Index ¶
- Constants
- func CidFromNamespacedSha256(namespacedHash []byte) (cid.Cid, error)
- func GetNode(ctx context.Context, bGetter blockservice.BlockGetter, root cid.Cid) (ipld.Node, error)
- func MustCidFromNamespacedSha256(hash []byte) cid.Cid
- func NamespacedSha256FromCID(cid cid.Cid) []byte
- func NewNMTLeafNode(id cid.Cid, data []byte) ipld.Node
- func NewNMTNode(id cid.Cid, l, r []byte) ipld.Node
- func NewNamespaceHasher(hasher *nmt.Hasher) hash.Hash
- func RandNamespacedCID(t *testing.T) cid.Cid
Constants ¶
View Source
const ( // NmtCodec is the codec used for leaf and inner nodes of a Namespaced Merkle Tree. NmtCodec = 0x7700 // Sha256Namespace8Flagged is the multihash code used to hash blocks // that contain an NMT node (inner and leaf nodes). Sha256Namespace8Flagged = 0x7701 )
Variables ¶
This section is empty.
Functions ¶
func CidFromNamespacedSha256 ¶
CidFromNamespacedSha256 uses a hash from an nmt tree to create a CID
func MustCidFromNamespacedSha256 ¶
func MustCidFromNamespacedSha256(hash []byte) cid.Cid
MustCidFromNamespacedSha256 is a wrapper around cidFromNamespacedSha256 that panics in case of an error. Use with care and only in places where no error should occur.
func NamespacedSha256FromCID ¶
func NamespacedSha256FromCID(cid cid.Cid) []byte
NamespacedSha256FromCID derives the Namespaced hash from the given CID.
func NewNMTLeafNode ¶
func NewNMTNode ¶
func RandNamespacedCID ¶ added in v0.3.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.