Documentation ¶
Index ¶
- Constants
- func CalculateID(namespace, encoded string, hashAlgorithmAsMultihashCode uint) (string, error)
- func CalculateUniqueSuffix(encoded string, hashAlgorithmAsMultihashCode uint) (string, error)
- func ComputeMultihash(multihashCode uint, bytes []byte) ([]byte, error)
- func DecodeString(encodedContent string) ([]byte, error)
- func EncodeToString(data []byte) string
- func GetHash(multihashCode uint) (h hash.Hash, err error)
- func GetMultihashCode(encodedMultihash string) (uint64, error)
- func IsComputedUsingHashAlgorithm(encodedMultihash string, code uint64) bool
- func IsSupportedMultihash(encodedMultihash string) bool
- func MarshalCanonical(v interface{}) ([]byte, error)
- func MarshalIndentCanonical(v interface{}, prefix, indent string) ([]byte, error)
Constants ¶
const NamespaceDelimiter = ":"
NamespaceDelimiter is the delimiter that separates the namespace from the unique suffix
Variables ¶
This section is empty.
Functions ¶
func CalculateID ¶
CalculateID calculates the ID from an encoded value
func CalculateUniqueSuffix ¶ added in v0.1.2
CalculateUniqueSuffix calculates the unique suffix from an encoded value
func ComputeMultihash ¶
ComputeMultihash will compute the hash for the supplied bytes using multihash code
func DecodeString ¶
DecodeString decodes the encoded content to Bytes
func EncodeToString ¶
EncodeToString encodes the bytes to string
func GetMultihashCode ¶ added in v0.1.2
GetMultihashCode returns multihash code from encoded multihash
func IsComputedUsingHashAlgorithm ¶ added in v0.1.3
IsComputedUsingHashAlgorithm checks to see if the given encoded hash has been hashed using multihash code
func IsSupportedMultihash ¶
IsSupportedMultihash checks to see if the given encoded hash has been hashed using valid multihash code
func MarshalCanonical ¶
MarshalCanonical marshals the object into a canonical JSON format
func MarshalIndentCanonical ¶
MarshalIndentCanonical is like MarshalCanonical but applies Indent to format the output. Each JSON element in the output will begin on a new line beginning with prefix followed by one or more copies of indent according to the indentation nesting.
Types ¶
This section is empty.