crypto

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BCryptCost = bcrypt.DefaultCost

BCryptCost is the cost factor used for generating bcrypted passwords

Functions

func CompareHashAndPassword

func CompareHashAndPassword(hashedPassword, password []byte) error

CompareHashAndPassword compares a password to a bcrypted hash of the password

func GenerateRandomKey

func GenerateRandomKey(strength int) []byte

GenerateRandomKey generates a random key of length strength

func GenerateRandomURLSafeKey

func GenerateRandomURLSafeKey(strength int) string

GenerateRandomURLSafeKey generates a random key of length strength and returns the base64 encoded string

func Hash

func Hash(args ...string) string

Hash computes the md5 checksum of the given strings

func HashPassword

func HashPassword(pass string) ([]byte, error)

HashPassword bcrypts a password using bcrypt.DefaultCost as the cost factor

Types

This section is empty.

Jump to

Keyboard shortcuts

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