secret

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID() (string, error)

NewID generates a unique 128-bit random ID as a hex-encoded string.

func RandomAlphaNumeric

func RandomAlphaNumeric(length int) (string, error)

RandomAlphaNumeric generates a random string of the specified length using the characters [a-z0-9].

Types

type Secret

type Secret []byte

func FromHexString

func FromHexString(s string) (Secret, error)

FromHexString parses a hex-encoded string into a secret.

func New

func New(len int) (Secret, error)

New generates a random secret of the given length.

func (Secret) Equal

func (s Secret) Equal(other Secret) bool

func (Secret) MarshalText

func (s Secret) MarshalText() ([]byte, error)

func (Secret) String

func (s Secret) String() string

String returns the hex-encoded string representation of the secret.

func (*Secret) UnmarshalText

func (s *Secret) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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