dcas

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decorator = &decorator{}

Decorator is an off-ledger decorator that ensures the key is the hash of the value.

Functions

func GetCASKeyAndValue

func GetCASKeyAndValue(content []byte) (string, []byte, error)

GetCASKeyAndValue first normalizes the content (i.e. if the content is a JSON doc then the fields are marshaled in a deterministic order) and returns the content-addressable key (encoded in base64) along with the normalized value.

func GetCASKeyAndValueBase58

func GetCASKeyAndValueBase58(content []byte) (string, []byte, error)

GetCASKeyAndValueBase58 first normalizes the content (i.e. if the content is a JSON doc then the fields are marshaled in a deterministic order) and returns the content-addressable key (first encoded in base64 and then in base58) along with the normalized value.

func Validator

func Validator(_, _, _, key string, value []byte) error

Validator is an off-ledger validator that validates the CAS key against the value

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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