utils

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPKCS8PrivateKey = errors.New("invalid PKCS8 private key")
	ErrInvalidPKIXPublicKey   = errors.New("invalid PKIX public key")
)

Functions

func ConstantTimeCompareBytes added in v1.0.0

func ConstantTimeCompareBytes(a []byte, b []byte) bool

ConstantTimeCompareBytes compares two byte slices in constant time

func DecodeED25519PrivateKey added in v1.0.0

func DecodeED25519PrivateKey(encoded []byte) (ed25519.PrivateKey, error)

func DecodePublicKey added in v1.0.0

func DecodePublicKey(encoded []byte) (crypto.PublicKey, error)

func DefaultFiberApp

func DefaultFiberApp() *fiber.App

DefaultFiberApp returns a new fiber app with sensible defaults

func EncodeED25519PrivateKey added in v1.0.0

func EncodeED25519PrivateKey(privateKey ed25519.PrivateKey) []byte

func EncodePublicKey added in v1.0.0

func EncodePublicKey(publicKey crypto.PublicKey) []byte

func GenericZero added in v1.0.0

func GenericZero[T any]() T

func RandomBase32Bytes added in v1.0.0

func RandomBase32Bytes(length int) []byte

RandomBase32Bytes generates a random byte slice length n of base32 characters

func RandomBase32String added in v1.0.0

func RandomBase32String(n int) string

RandomBase32String generates a random base32 string of length n

func RandomBytes

func RandomBytes(n int) []byte

RandomBytes generates a random byte slice of length n

func RandomString

func RandomString(n int) string

RandomString generates a random string of length n

func RemovePortFromHostPort added in v1.0.0

func RemovePortFromHostPort(hostport string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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