utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashMD5

func HashMD5(text string) (string, error)

HashMD5 hashes the given text using the MD5 algorithm. It returns the hashed text as a string.

func HashPassword

func HashPassword(text string) (string, error)

HashPassword hashes the given text using bcrypt algorithm. It returns the hashed password as a string.

func VerifyHashMD5

func VerifyHashMD5(plainText string, hashValue string) bool

VerifyHashMD5 compares the plain text with the hashed value. It returns true if the hash values match, otherwise false.

func VerifyPassword

func VerifyPassword(normal string, hashed string) error

VerifyPassword compares the normal (plain) password with the hashed password. It returns an error if the passwords don't match.

Types

This section is empty.

Jump to

Keyboard shortcuts

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