util

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(password, hash string) bool

ComparePassword compares the plain text password and the hash and returns true if they're equal or false otherwise.

func GenRandomString

func GenRandomString(n uint) string

GenRandomString generates a random string with length n for a fixed alphabet.

func HashPassword

func HashPassword(password string) string

HashPassword returns a bcrypt encoded password hash. The password is hashed using SHA256 first to limit its length.

func SHA256Base64

func SHA256Base64(str string) string

SHA256Base64 hashes a string to SHA256 and encodes it to base64. It panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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