utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdentityFunc

func IdentityFunc[T any]() func(T) T

func IgnoreError added in v0.5.0

func IgnoreError(fn func() error)

IgnoreError runs a function that returns an error and silently ignores the error. It is intended to be used when the error from a cleanup operation (e.g., Close) is non-critical and can be safely discarded.

Example:

defer IgnoreError(file.Close)

func IgnoreErrorWithOneArg added in v0.5.0

func IgnoreErrorWithOneArg[T any](fn func(t T) error, t T)

func IsNil added in v0.5.0

func IsNil[T any](value T) bool

Types

type Hashable added in v0.5.0

type Hashable []byte

func (Hashable) Raw added in v0.5.0

func (id Hashable) Raw() []byte

func (Hashable) RawString added in v0.5.0

func (id Hashable) RawString() string

func (Hashable) String added in v0.5.0

func (id Hashable) String() string

type Hasher added in v0.5.0

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

func NewSHA256Hasher added in v0.5.0

func NewSHA256Hasher() *Hasher

func (*Hasher) AddBool added in v0.5.0

func (h *Hasher) AddBool(b bool) (int, error)

func (*Hasher) AddBytes added in v0.5.0

func (h *Hasher) AddBytes(b []byte) error

func (*Hasher) AddFloat64 added in v0.5.0

func (h *Hasher) AddFloat64(f float64) error

func (*Hasher) AddG1s added in v0.5.0

func (h *Hasher) AddG1s(generators []*math.G1) error

func (*Hasher) AddInt added in v0.5.0

func (h *Hasher) AddInt(i int) error

func (*Hasher) AddInt32 added in v0.5.0

func (h *Hasher) AddInt32(i int32) error

func (*Hasher) AddString added in v0.5.0

func (h *Hasher) AddString(s string) error

func (*Hasher) AddUInt64 added in v0.5.0

func (h *Hasher) AddUInt64(i uint64) error

func (*Hasher) Digest added in v0.5.0

func (h *Hasher) Digest() []byte

func (*Hasher) HexDigest added in v0.5.0

func (h *Hasher) HexDigest() string

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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