cid

package
v0.0.0-...-efc3c05 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentID

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

ContentID represents a CID

func NewContentID

func NewContentID(id *big.Int) (*ContentID, error)

NewContentID creates a CID object

func NewContentIDFromBytes

func NewContentIDFromBytes(id []byte) *ContentID

NewContentIDFromBytes creates a CID object

func NewRandomContentID

func NewRandomContentID() (*ContentID, error)

NewRandomContentID creates a random content id object

func (ContentID) CalculateHash

func (n ContentID) CalculateHash() ([]byte, error)

CalculateHash hashes the values of a TestContent

func (ContentID) Equals

func (n ContentID) Equals(other merkletree.Content) (bool, error)

Equals tests for equality of two Contents

func (ContentID) MarshalJSON

func (n ContentID) MarshalJSON() ([]byte, error)

MarshalJSON is used to marshal NodeID into bytes

func (*ContentID) ToBytes

func (n *ContentID) ToBytes() []byte

ToBytes returns the byte array representation of the CID.

func (*ContentID) ToString

func (n *ContentID) ToString() string

ToString returns a string for the CID.

func (*ContentID) UnmarshalJSON

func (n *ContentID) UnmarshalJSON(p []byte) error

UnmarshalJSON is used to unmarshal bytes into ContentID

Jump to

Keyboard shortcuts

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