scrypt

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 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 NewScrypt added in v0.3.18

func NewScrypt(config *types.Config) (scheme.Scheme, error)

NewScrypt creates a new Scrypt crypto instance

Types

type Params

type Params struct {
	N      int
	R      int
	P      int
	KeyLen int
}

Params represents parameters for Scrypt algorithm

func DefaultParams

func DefaultParams() *Params

func FromParams added in v0.3.18

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

FromParams parses Scrypt parameters from a map[string]string.

func (*Params) FromMap added in v0.3.18

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

func (*Params) IsNil added in v1.1.0

func (p *Params) IsNil() bool

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

type Scrypt

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

Scrypt implements the Scrypt hashing algorithm

func (*Scrypt) Hash

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

Hash implements the hash method

func (*Scrypt) HashWithSalt

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

HashWithSalt implements the hash with salt method

func (*Scrypt) Spec added in v1.1.0

func (c *Scrypt) Spec() types.Spec

func (*Scrypt) Verify

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

Verify implements the verify method

Jump to

Keyboard shortcuts

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