bcrypt

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func DefaultParams

func DefaultParams() interfaces.Params

func NewBcrypt added in v0.3.18

func NewBcrypt(config *types.Config) (interfaces.Cryptographic, error)

Types

type Bcrypt

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

Bcrypt implements the Bcrypt hashing algorithm

func (*Bcrypt) Hash

func (c *Bcrypt) Hash(password string) (*types.HashParts, error)

Hash implements the hash method

func (*Bcrypt) HashWithSalt

func (c *Bcrypt) HashWithSalt(password string, salt []byte) (*types.HashParts, error)

HashWithSalt implements the hash with salt method WARNING: Manually concatenating salt for Bcrypt is INSECURE as Bcrypt handles salt internally. This implementation is for framework consistency, but should be used with caution.

func (*Bcrypt) Type

func (c *Bcrypt) Type() types.Type

func (*Bcrypt) Verify

func (c *Bcrypt) Verify(parts *types.HashParts, password string) error

Verify implements the verify method WARNING: Manually concatenating salt for Bcrypt is INSECURE as Bcrypt handles salt internally. This implementation is for framework consistency, but should be used with caution.

type Params

type Params struct {
	Cost int
}

func FromMap added in v0.3.18

func FromMap(m map[string]string) (params *Params, err error)

FromMap parses Argon2 parameters from string

func (*Params) FromMap added in v0.3.18

func (p *Params) FromMap(params map[string]string) error

func (*Params) String

func (p *Params) String() string

String returns the string representation of parameters

func (*Params) ToMap added in v0.3.18

func (p *Params) ToMap() map[string]string

ToMap converts Params to a map[string]string

func (*Params) Validate added in v0.3.18

func (p *Params) Validate(config *types.Config) error

Jump to

Keyboard shortcuts

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