scrypt

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashID = "s0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	WorkFactor     int
	MemBlocksize   int
	ParallelFactor int
}

Config are scrypt params

Recommended minimum parameters are:

  • WorkFactor: 32768
  • MemBlocksize: 8
  • ParallelFactor: 1

func (*Config) String

func (c *Config) String() string

type Hasher

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

Hasher implements h2hash.Hasher for scrypt

func New

func New(hashlen, saltlen int, config Config) *Hasher

New creates a new scrypt hasher

func (*Hasher) Hash

func (h *Hasher) Hash(msg []byte) (string, error)

func (*Hasher) ID

func (h *Hasher) ID() string

func (*Hasher) Verify

func (h *Hasher) Verify(msg []byte, msghash string) (bool, error)

Jump to

Keyboard shortcuts

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