hash

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCost = 10

DefaultCost is the bcrypt cost used when not specified.

Variables

This section is empty.

Functions

func Check

func Check(plaintext, hash string) bool

Check verifies that the plaintext password matches the hash.

func Make

func Make(password string) (string, error)

Make hashes the given password using bcrypt. Cost defaults to 10; use MakeWithCost for custom cost.

func MakeWithCost

func MakeWithCost(password string, cost int) (string, error)

MakeWithCost hashes the password with the given bcrypt cost (4-31).

Types

This section is empty.

Jump to

Keyboard shortcuts

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