scrypt

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultN = 1 << 16
	DefaultR = 10
	DefaultP = 2

	DefaultKeyLen  = 128
	DefaultSaltLen = 64
)

Variables

View Source
var (
	DefaultProvider = New()
)

Functions

This section is empty.

Types

type Provider

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

Provider handles internal state and algorythm parameters

func New

func New() *Provider

New returns new scrypt provider

func (*Provider) Hash

func (p *Provider) Hash(plaintext []byte) []byte

Hash returns scrypt hash of plaintext

func (*Provider) HashString

func (p *Provider) HashString(plaintext string) []byte

HashString returns scrypt hash of plaintext

func (*Provider) NeedsRehash

func (p *Provider) NeedsRehash(hash []byte) bool

NeedsRehash checks if provided hash needs rehash

func (*Provider) Valid

func (p *Provider) Valid(hash, plain []byte) bool

Valid checks if provided plaintext is valid for given hash

Jump to

Keyboard shortcuts

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