fcrmerkletree

package
v0.0.0-...-12ab560 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fcrmerkletree - provides methods to work with Merkle Tree data structure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FCRMerkleProof

type FCRMerkleProof struct {
	// contains filtered or unexported fields
}

FCRMerkleProof is the proof of a single cid in a merkle tree.

func (FCRMerkleProof) MarshalJSON

func (mp FCRMerkleProof) MarshalJSON() ([]byte, error)

MarshalJSON is used to marshal FCRMerkleProof into bytes.

func (*FCRMerkleProof) UnmarshalJSON

func (mp *FCRMerkleProof) UnmarshalJSON(p []byte) error

UnmarshalJSON is used to unmarshal bytes into FCRMerkleProof.

func (*FCRMerkleProof) VerifyContent

func (mp *FCRMerkleProof) VerifyContent(content merkletree.Content, root string) bool

VerifyContent is used to verify a given content and a given root matches the proof.

type FCRMerkleTree

type FCRMerkleTree struct {
	// contains filtered or unexported fields
}

FCRMerkleTree is used to store a list of CIDs.

func CreateMerkleTree

func CreateMerkleTree(contents []merkletree.Content) (*FCRMerkleTree, error)

CreateMerkleTree creates a merkle tree from a list of cids.

func (*FCRMerkleTree) GenerateMerkleProof

func (mt *FCRMerkleTree) GenerateMerkleProof(content merkletree.Content) (*FCRMerkleProof, error)

GenerateMerkleProof gets the merkle proof for a given cid.

func (*FCRMerkleTree) GetMerkleRoot

func (mt *FCRMerkleTree) GetMerkleRoot() string

GetMerkleRoot returns the merkle root of the tree.

Jump to

Keyboard shortcuts

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