serialization

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const VERIFICATION_KEY_HASH_SIZE = 28

Variables

This section is empty.

Functions

func Blake2bHash

func Blake2bHash(data []byte) ([]byte, error)

* Blake2bHash computes the Blake2b hash of the given data.

Params:

data ([]byte): The data to hash.

Returns:

[]byte: The Blake2b hash of the data.
error: An error if the hashing fails.

Types

type Clonable

type Clonable[T any] interface {
	Clone() T
}

type ConstrainedBytes

type ConstrainedBytes struct {
	Payload []byte
}

func (*ConstrainedBytes) MarshalCBOR

func (cb *ConstrainedBytes) MarshalCBOR() ([]byte, error)

*

MarshalCBOR serializes ConstrainedBytes into a CBOR-encoded byte slice.

Returns:
	[]byte: A CBOR-encoded byte slice representing the ConstrainedBytes.
	error: An error if serialization fails.

func (*ConstrainedBytes) UnmarshalCBOR

func (cb *ConstrainedBytes) UnmarshalCBOR(data []byte) error

*

UnmarshalCBOR deserializes a CBOR-encoded byte slice into ConstrainedBytes.

Params:
	data ([]byte): The CBOR-encoded byte slice.

Returns:
	error: An error if deserialization fails.

type CustomBytes

type CustomBytes struct {
	Value string
	// contains filtered or unexported fields
}

func NewCustomBytes added in v1.0.11

func NewCustomBytes(value string) CustomBytes

func (*CustomBytes) MarshalCBOR

func (cb *CustomBytes) MarshalCBOR() ([]byte, error)

*

MarshalCBOR serializes CustomBytes into a CBOR-encoded byte slice.

Returns:
	[]byte: A CBOR-encoded byte slice representing the CustomBytes.
	error: An error if serialization fails.

func (CustomBytes) String

func (cb CustomBytes) String() string

*

String returns the Value's string representation of a CustomBytes.

Returns:
	string: The Value's string representation of CustomBytes.

func (*CustomBytes) UnmarshalCBOR

func (cb *CustomBytes) UnmarshalCBOR(value []byte) error

*

UnmarshalCBOR deserializes a CBOR-encoded byte slice into CustomBytes.

Params:
	value ([]byte): The CBOR-encoded byte slice.

Returns:
	error: An error if deserialization fails.

type DatumHash

type DatumHash ConstrainedBytes

func (*DatumHash) Equal

func (dh *DatumHash) Equal(other DatumHash) bool

*

Equal checks if two DatumHash instances are equal.

Params:
	other (DatumHash): The other DatumHash to compare to.

Returns:
	bool: True if the DatumHashes are equal, false otherwise.

type PubKeyHash

type PubKeyHash [28]byte

type ScriptDataHash

type ScriptDataHash ConstrainedBytes

type ScriptHash

type ScriptHash [28]byte

func (*ScriptHash) Bytes

func (sh *ScriptHash) Bytes() []byte

*

Bytes returns the underlying byte slice of a ScriptHash.

Returns:
	[]byte: The byte slice representation of the ScriptHash.

type TransactionId

type TransactionId ConstrainedBytes

Jump to

Keyboard shortcuts

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