encryption

package
v0.0.0-...-72dc9a7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Codec = mc.Raw
View Source
const MhLength = -1
View Source
const MhType = mh.SHA2_256
View Source
const Version = 1

Variables

This section is empty.

Functions

func BaseDecode

func BaseDecode(data string) (multi.Encoding, []byte, error)

func BaseEncode

func BaseEncode(base multi.Encoding, data []byte) (string, error)

func GetCid

func GetCid(str string) (cid.Cid, error)

func GetCidString

func GetCidString(str string) (string, error)

func HashDecode

func HashDecode(buf []byte) (*multi.DecodedMultihash, error)

Decode parses multihash bytes into a DecodedMultihash.

func HashEncode

func HashEncode(buf []byte, code uint64) ([]byte, error)

Encode a hash digest along with the specified function code. Note: the length is derived from the length of the digest itself.

The error return is legacy; it is always nil.

Types

type Multibase

type Multibase interface {
	BaseEncode(base multi.Encoding, data []byte) (string, error)
	BaseDecode(data string) (multi.Encoding, []byte, error)
}

type Multihash

type Multihash interface {
	HashEncode(buf []byte, code uint64) ([]byte, error)
	HashDecode(buf []byte) (*multi.DecodedMultihash, error)
}

Jump to

Keyboard shortcuts

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