bcrypt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const SALT_BCRYPT = 12

Variables

This section is empty.

Functions

func Compare

func Compare(hash []byte, pass []byte) (err error)

Compare compares a hashed password with a plaintext password. It uses bcrypt.CompareHashAndPassword to perform the comparison. If the passwords match, it returns nil. Otherwise, it returns an error.

func Hash

func Hash(p []byte) (pass string, err error)

Hash generates a bcrypt hash from the given password. It takes a byte slice as input and returns the hashed password as a string. If an error occurs during the hashing process, it returns an empty string and the error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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