coder

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coder

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

func New

func New(cfg *Config) *Coder

func (*Coder) CompareHash

func (c *Coder) CompareHash(hash string, text string) error

func (*Coder) Decrypt

func (c *Coder) Decrypt(text string) (string, error)

func (*Coder) Encrypt

func (c *Coder) Encrypt(text string) string

func (*Coder) Hash

func (c *Coder) Hash(text string) (string, error)

type Config

type Config struct {
	Secret   string `env:"ENCRYPT_SECRET" env-default:""`
	HashCost int    `env:"HASH_COST" env-default:"10"`
}

Jump to

Keyboard shortcuts

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