helper

package
v0.0.0-...-f123b97 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TIME_LIMIT_CODE_LENGTH = 12 + 6 + 40

Variables

This section is empty.

Functions

func CreateTimeLimitCode

func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string

CreateTimeLimitCode 根据给定的数据生成带过期时间的码。 格式: 12 日期 + 6 分钟 + 40 sha1

func HashEmail

func HashEmail(email string) string

HashEmail 将邮箱地址 Md5 转换成 Avatar 头像哈希 https://en.gravatar.com/site/implement/hash/

func Substr

func Substr(s string, start, length int) string

Substr 根据给定的开始位置和长度裁剪字符串。

func VerifyTimeLimitCode

func VerifyTimeLimitCode(data string, minutes int, code string) bool

VerifyTimeLimitCode 检查限时验证码是否正确。

Types

This section is empty.

Jump to

Keyboard shortcuts

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