hashing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateModelMultihash

func CalculateModelMultihash(value interface{}, alg uint) (string, error)

CalculateModelMultihash calculates model multihash.

func ComputeMultihash

func ComputeMultihash(multihashCode uint, bytes []byte) ([]byte, error)

ComputeMultihash will compute the hash for the supplied bytes using multihash code.

func GetHash

func GetHash(hash crypto.Hash, data []byte) ([]byte, error)

GetHash calculates hash of data using hash function identified by hash.

func GetHashFromMultihash

func GetHashFromMultihash(multihashCode uint) (h crypto.Hash, err error)

GetHashFromMultihash will return hash based on specified multihash code.

func GetMultihash added in v0.6.0

func GetMultihash(encodedMultihash string) (*multihash.DecodedMultihash, error)

GetMultihash returns decoded multihash from encoded multihash.

func GetMultihashCode

func GetMultihashCode(encodedMultihash string) (uint64, error)

GetMultihashCode returns multihash code from encoded multihash.

func IsComputedUsingMultihashAlgorithms added in v0.6.0

func IsComputedUsingMultihashAlgorithms(encodedMultihash string, codes []uint) bool

IsComputedUsingMultihashAlgorithms checks to see if the given encoded hash has been hashed using one of supplied code.

func IsSupportedMultihash

func IsSupportedMultihash(encodedMultihash string) bool

IsSupportedMultihash checks to see if the given encoded hash has been hashed using valid multihash code.

func IsValidModelMultihash

func IsValidModelMultihash(model interface{}, modelMultihash string) error

IsValidModelMultihash compares model with provided model multihash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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