passwordutil

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package passwordutil provides utils for generating and validating passwords for users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(pwd string, hashedPwd string) (bool, error)

func Generate

func Generate(length int) string

Generate returns random password of specified length

Note that recommended length is 26, based on rand.Text recommendation, to get 128 bits of randomness, which is plenty for bootstrap password.

func GeneratePasswordHash

func GeneratePasswordHash(pwd string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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