utils

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: AGPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// SubjectPositionIndex save subject in index part of claim. By default.
	SubjectPositionIndex = "index"
	// SubjectPositionValue save subject in value part of claim.
	SubjectPositionValue = "value"

	// MerklizedRootPositionIndex merklized root is stored in index.
	MerklizedRootPositionIndex = "index"
	// MerklizedRootPositionValue merklized root is stored in value.
	MerklizedRootPositionValue = "value"
	// MerklizedRootPositionNone merklized root is not stored in the claim. By Default.
	MerklizedRootPositionNone = ""
)

Variables

This section is empty.

Functions

func CreateSchemaHash

func CreateSchemaHash(schemaID []byte) core.SchemaHash

CreateSchemaHash computes schema hash from schemaID

func DataFillsSlot

func DataFillsSlot(slot, newData []byte) bool

DataFillsSlot checks if newData fills into slot capacity ()

func FieldToByteArray

func FieldToByteArray(field interface{}) ([]byte, error)

FieldToByteArray convert fields to byte representation based on type

func Keccak256

func Keccak256(data ...[]byte) []byte

Keccak256 calculates the Keccak256 hash of the input data.

func SwapEndianness added in v0.2.0

func SwapEndianness(buf []byte) []byte

SwapEndianness swaps the endianness of the value encoded in buf. If buf is Big-Endian, the result will be Little-Endian and vice-versa.

Types

This section is empty.

Jump to

Keyboard shortcuts

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