Documentation ¶
Overview ¶
Package fcrmerkletree - provides methods to work with Merkle Tree data structure
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) FromBytes ¶
func (mp *FCRMerkleProof) FromBytes(p []byte) error
FromBytes is used to turn bytes into FCRMerkleProof.
func (*FCRMerkleProof) ToBytes ¶
func (mp *FCRMerkleProof) ToBytes() ([]byte, error)
ToBytes is used to turn FCRMerkleProof into bytes.
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.