crypto

package
v0.0.0-...-c9c8c44 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bcrypt

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

func (Bcrypt) GenerateHash

func (c Bcrypt) GenerateHash(ctx context.Context, plainText string) (string, error)

func (Bcrypt) VerifyHash

func (c Bcrypt) VerifyHash(ctx context.Context, plainText string, hash string) (bool, error)

type Crypto

type Crypto interface {
	GenerateHash(ctx context.Context, plainText string) (string, error)
	VerifyHash(ctx context.Context, plainText string, hash string) (bool, error)
}

func NewBcrypt

func NewBcrypt(config configs.ConfigBcrypt) Crypto

func NewCryptoMock

func NewCryptoMock() Crypto

func ProviderSet

func ProviderSet(
	config configs.Config,
) Crypto

type CryptoMock

type CryptoMock struct{}

func (CryptoMock) GenerateHash

func (c CryptoMock) GenerateHash(ctx context.Context, plainText string) (string, error)

func (CryptoMock) VerifyHash

func (c CryptoMock) VerifyHash(ctx context.Context, plainText string, hash string) (bool, error)

Jump to

Keyboard shortcuts

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