cidenc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 2 Imported by: 57

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	Base    mbase.Encoder // The multibase to use
	Upgrade bool          // If true upgrade CIDv0 to CIDv1 when encoding
}

Encoder is a basic Encoder that will encode CIDs using a specified base and optionally upgrade a CIDv0 to CIDv1

func Default

func Default() Encoder

Default return a new default encoder

func (Encoder) Encode

func (enc Encoder) Encode(c cid.Cid) string

Encode encodes the cid using the parameters of the Encoder

func (Encoder) Recode

func (enc Encoder) Recode(v string) (string, error)

Recode reencodes the cid string to match the parameters of the encoder

Jump to

Keyboard shortcuts

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