utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFileViper

func LoadConfigFileViper(path string) (*viper.Viper, error)

LoadConfigFileViper 从配置文件加载配置到viper

func RandStringHex

func RandStringHex(n int) (string, error)

Generate a random string for hexadecimal. Docker Id use this.

func RandStringNumber

func RandStringNumber(n int) (string, error)

RandStringNumber 创建指定位数的数字字符串; n < 18 , 常用于短信验证码等情况

func Sha256PasswordEncrypt

func Sha256PasswordEncrypt(password string) (string, string, error)

Sha256PasswordEncrypt 对密码进行sha256加密

func Sha256PasswordValidate

func Sha256PasswordValidate(password, salt, hash string) bool

Sha256PasswordValidate 对密码进行sha256加密,并与已加密的密码进行比较

Types

This section is empty.

Jump to

Keyboard shortcuts

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