passhash

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 2 Imported by: 1

README

passlib

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

func NewGenerator

func NewGenerator() *Generator

func (*Generator) AllowRepeat

func (g *Generator) AllowRepeat() *Generator

AllowRepeat allows repeats in passwords

func (*Generator) DisallowRepeat

func (g *Generator) DisallowRepeat() *Generator

DisallowRepeat allows repeats in passwords

func (*Generator) Generate

func (g *Generator) Generate() (string, error)

Generate generates some random password with rules

func (*Generator) Length

func (g *Generator) Length(length int) *Generator

Length set generated password length

func (*Generator) NoUpper

func (g *Generator) NoUpper() *Generator

NoUpper no uppercase in passwords

func (*Generator) NumDigits

func (g *Generator) NumDigits(numDigits int) *Generator

NumDigits set number of digits in generated password

func (*Generator) NumSymbols

func (g *Generator) NumSymbols(numSymbols int) *Generator

NumSymbols set number of symbols in generated password

func (*Generator) WithUpper

func (g *Generator) WithUpper() *Generator

WithUpper allow uppercase in passwords

type Hasher

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

func NewHash

func NewHash() *Hasher

func (*Hasher) CheckPasswordHash

func (h *Hasher) CheckPasswordHash(password, hash string) bool

CheckPasswordHash checks plain password with hashed version

func (*Hasher) Cost

func (h *Hasher) Cost(cost int) *Hasher

Cost setup hash cost [4, 31]. Default 16

func (*Hasher) HashPassword

func (h *Hasher) HashPassword(password string) (string, error)

HashPassword hashes plain password with bcrypt

Jump to

Keyboard shortcuts

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