helpers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptCheck

func BcryptCheck(password, hash string) bool

BcryptCheck 对比明文密码和数据库的哈希值

func BcryptHash

func BcryptHash(password string) (string, error)

BcryptHash 使用 bcrypt 对密码进行加密

func BcryptIsHashed

func BcryptIsHashed(str string) bool

BcryptIsHashed 判断字符串是否是哈希过的数据

func MicrosecondsStr

func MicrosecondsStr(elapsed time.Duration) string

MicrosecondsStr 将 time.Duration 类型(nano seconds 为单位) 输出为小数点后 3 位的 ms (microsecond 毫秒,千分之一秒)

func Slugify

func Slugify(s string) string

Slugify converts s into a URL-safe lowercase slug. Non-ASCII characters (e.g. Chinese) that produce an empty slug after stripping are replaced with a short random suffix so we never return the ambiguous string "default".

Types

This section is empty.

Jump to

Keyboard shortcuts

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