security

package
v0.0.0-...-42ff6b3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordsMatch

func CheckPasswordsMatch(hashedPassword, currPassword string,
	salt []byte) bool

Check if two passwords match

func GenerateRandomSalt

func GenerateRandomSalt() []byte

Generate 16 bytes randomly and securely using the Cryptographically secure pseudorandom number generator (CSPRNG) in the crypto.rand package

func HashPassword

func HashPassword(password string, salt []byte) string

Combine password and salt then hash them using the SHA-512 hashing algorithm and then return the hashed password as a base64 encoded string

Types

This section is empty.

Jump to

Keyboard shortcuts

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