passwd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Lowercase Combination = 1 << iota
	Uppercase
	Number
	Special

	Alpha = Lowercase | Uppercase
	Word  = Alpha | Number
	All   = Word | Special
)

Variables

This section is empty.

Functions

func Check

func Check(password string) (Strength, Combination)

Check - Check password strong

func Encrypt

func Encrypt(password string) string

Encrypt - Encrypt password to bcrypt hash

func Generate

func Generate(length int, c Combination) string

func Verify

func Verify(hash, password string) bool

Verify - Verify bcrypt hash password

Types

type Combination

type Combination int

type Strength

type Strength int
const (
	Weak Strength = iota
	Low
	Medium
	High
)

Jump to

Keyboard shortcuts

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