keybinary

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteArray32

type ByteArray32 struct {
	// contains filtered or unexported fields
}

ByteArray32 contain a 32 bytes array.

func NewByteArray32

func NewByteArray32(arrayRef *[32]byte) (k *ByteArray32)

NewByteArray32 create new instance of ByteArray32 with given array reference. If arrayRef is nil the resulted instance will have array fill with empty (0/zero) value.

func (*ByteArray32) Clear

func (k *ByteArray32) Clear()

Clear empty key content.

func (*ByteArray32) CopyInto added in v0.0.6

func (k *ByteArray32) CopyInto(dst []byte) int

CopyInto copy array content into given dst with builtin copy.

func (*ByteArray32) IsZero added in v0.0.3

func (k *ByteArray32) IsZero() bool

IsZero return is content of array in zero.

func (*ByteArray32) Load

func (k *ByteArray32) Load(arrayRef *[32]byte)

Load copy given array into instance.

func (*ByteArray32) MarshalBinary

func (k *ByteArray32) MarshalBinary() (data []byte, err error)

MarshalBinary implement encoding.BinaryMarshaler interface.

func (*ByteArray32) MarshalText

func (k *ByteArray32) MarshalText() (text []byte, err error)

MarshalText implement encoding.TextMarshaler interface.

func (*ByteArray32) Ref added in v0.0.2

func (k *ByteArray32) Ref() (ref *[32]byte)

Ref return pointer references array.

func (*ByteArray32) String

func (k *ByteArray32) String() string

String convert k into string. Resulted string will be base64.RawStdEncoding encoded or empty string if k is nil.

func (*ByteArray32) UnmarshalBinary

func (k *ByteArray32) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary implement encoding.BinaryUnmarshaler interface.

func (*ByteArray32) UnmarshalText

func (k *ByteArray32) UnmarshalText(text []byte) (err error)

UnmarshalText implement encoding.TextUnmarshaler interface.

type ByteArray64

type ByteArray64 struct {
	// contains filtered or unexported fields
}

ByteArray64 contain a 64 bytes key.

func NewByteArray64

func NewByteArray64(arrayRef *[64]byte) (k *ByteArray64)

NewByteArray64 create new instance of ByteArray64 with given key. If arrayRef is nil the resulted instance will have array fill with empty (0/zero) value.

func (*ByteArray64) Clear

func (k *ByteArray64) Clear()

Clear empty key content.

func (*ByteArray64) CopyInto added in v0.0.6

func (k *ByteArray64) CopyInto(dst []byte) int

CopyInto copy array content into given dst with builtin copy.

func (*ByteArray64) IsZero added in v0.0.3

func (k *ByteArray64) IsZero() bool

IsZero return is content of array in zero.

func (*ByteArray64) Load

func (k *ByteArray64) Load(arrayRef *[64]byte)

Load copy given key into instance.

func (*ByteArray64) MarshalBinary

func (k *ByteArray64) MarshalBinary() (data []byte, err error)

MarshalBinary implement encoding.BinaryMarshaler interface.

func (*ByteArray64) MarshalText

func (k *ByteArray64) MarshalText() (text []byte, err error)

MarshalText implement encoding.TextMarshaler interface.

func (*ByteArray64) Ref added in v0.0.2

func (k *ByteArray64) Ref() (ref *[64]byte)

Ref return pointer references array.

func (*ByteArray64) String

func (k *ByteArray64) String() string

String convert k into string. Resulted string will be base64.RawStdEncoding encoded or empty string if k is nil.

func (*ByteArray64) UnmarshalBinary

func (k *ByteArray64) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary implement encoding.BinaryUnmarshaler interface.

func (*ByteArray64) UnmarshalText

func (k *ByteArray64) UnmarshalText(text []byte) (err error)

UnmarshalText implement encoding.TextUnmarshaler interface.

type ErrIncorrectDataSize

type ErrIncorrectDataSize struct {
	ExpectSize   int
	ReceivedSize int
}

ErrIncorrectDataSize indicate size of given data is not correct.

func (*ErrIncorrectDataSize) Error

func (e *ErrIncorrectDataSize) Error() string

Jump to

Keyboard shortcuts

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