plugin

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func CidFromNamespacedSha256(namespacedHash []byte) (cid.Cid, error)

CidFromNamespacedSha256 uses a hash from an nmt tree to create a CID

func GetNode added in v0.3.0

func GetNode(ctx context.Context, bGetter blockservice.BlockGetter, root cid.Cid) (ipld.Node, error)

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 NewNMTLeafNode(id cid.Cid, data []byte) ipld.Node

func NewNMTNode

func NewNMTNode(id cid.Cid, l, r []byte) ipld.Node

func NewNamespaceHasher

func NewNamespaceHasher(hasher *nmt.Hasher) hash.Hash

func RandNamespacedCID added in v0.3.0

func RandNamespacedCID(t *testing.T) cid.Cid

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL