Documentation ¶ Index ¶ func BcryptCheck(password, hash string) bool func BcryptHash(password string) (string, error) func BcryptIsHashed(str string) bool func MicrosecondsStr(elapsed time.Duration) string func Slugify(s string) string 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. Source Files ¶ View all Source files hash.gohelpers.go Click to show internal directories. Click to hide internal directories.