encryptutils

package
v0.0.0-...-8c7e783 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64Encryptor

type Base64Encryptor struct {
}

func NewBase64Encryptor

func NewBase64Encryptor() *Base64Encryptor

func (*Base64Encryptor) Decrypt

func (e *Base64Encryptor) Decrypt(data string) (string, error)

func (*Base64Encryptor) Encrypt

func (e *Base64Encryptor) Encrypt(data string) (string, error)

type BcryptHasher

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

func NewBcryptHasher

func NewBcryptHasher(cost int) *BcryptHasher

func (*BcryptHasher) Check

func (h *BcryptHasher) Check(password, hash string) bool

func (*BcryptHasher) Hash

func (h *BcryptHasher) Hash(password string) (string, error)

type Encryptor

type Encryptor interface {
	Encrypt(data string) (string, error)
	Decrypt(data string) (string, error)
}

type Hasher

type Hasher interface {
	Hash(password string) (string, error)
	Check(password, hash string) bool
}

Jump to

Keyboard shortcuts

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