hack

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PwdKey = []byte("c*&ea3b%D10dccWK")

16,24,32位字符串的话,分别对应AES-128,AES-192,AES-256 加密方法 key不能泄露

Functions

func AesDecrypt

func AesDecrypt(data []byte, key []byte) ([]byte, error)

AesDecrypt 解密

func AesEncrypt

func AesEncrypt(data []byte, key []byte) ([]byte, error)

AesEncrypt 加密

func CheckBirthdayValid

func CheckBirthdayValid(nYear, nMonth, nDay int) bool

生日日期格式效验

func CheckProvinceValid

func CheckProvinceValid(citizenNo []byte) bool

省份号码效验

func DateTimeSeries

func DateTimeSeries() int64

func DateToString

func DateToString() string

func DayTimeSeries

func DayTimeSeries() int

func DecryptByAes

func DecryptByAes(data string) ([]byte, error)

DecryptByAes Aes 解密

func EncryptByAes

func EncryptByAes(data []byte) (string, error)

EncryptByAes Aes加密 后 base64 再加

func GetCitizenNoInfo

func GetCitizenNoInfo(citizenNo []byte) (err error, birthday, sex, address string)

得到身份证号码,生日, 性别, 省份地址信息

func GetCurrentPath

func GetCurrentPath() (string, error)

func GetNumber

func GetNumber() string

func GetSMS

func GetSMS() string

func Getenv

func Getenv(key string, def interface{}) interface{}

func Int64InSlice

func Int64InSlice(a int64, list []int64) bool

func IsLeapYear

func IsLeapYear(nYear int) bool

func IsValidCitizenNo

func IsValidCitizenNo(citizenNo *[]byte) bool

效验有效地身份证号码

func IsValidCitizenNo18

func IsValidCitizenNo18(citizenNo18 *[]byte) bool

效验18位身份证

func Isset

func Isset(arr []interface{}, index int) bool

func ListStringToJson

func ListStringToJson(param []string) string

func MapStringMerge

func MapStringMerge(list ...map[string]string) (result map[string]string)

func MapToJson

func MapToJson(param map[string]interface{}) string

func Md5s

func Md5s(s string) string

func NewDateOffset

func NewDateOffset(years, months, days int) int

func NewTimestamp

func NewTimestamp() int64

func RandomID

func RandomID() string

func Sha1s

func Sha1s(s string) string

func Sha256s

func Sha256s(s string) string

func Sign

func Sign(data map[string]interface{}, key string) (sign string)

func SignString

func SignString(data map[string]string, key string) (sign string)

func SignalChannel

func SignalChannel(call func())

func StringHexArray

func StringHexArray(str string) []string

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringToInt64

func StringToInt64(s string) int64

func StringToTimestamp

func StringToTimestamp(val string) int64

func TimestampToDate

func TimestampToDate(ts string) string

func TimestampToString

func TimestampToString(ts int64) string

func TimestampToTime

func TimestampToTime(ts int64) int64

func ToDayStartTime

func ToDayStartTime(t time.Time) time.Time

func ToFloat64

func ToFloat64(t interface{}) float64

func ToFormatTimeZone

func ToFormatTimeZone(template string, from string, value string) string

格式化后的UTC时区转CST

func ToInt

func ToInt(t interface{}) int

func ToInt64

func ToInt64(t interface{}) int64

func ToString

func ToString(t interface{}) string

func Unshift

func Unshift(slice, v interface{}) (interface{}, error)

func Uuid

func Uuid() string

func VerifyName

func VerifyName(name string) bool

func VerifyPhoneFormat

func VerifyPhoneFormat(phone string) bool

func YearsToString

func YearsToString() string

Types

type SnowFlake

type SnowFlake struct {
	sync.Mutex // 锁
	// contains filtered or unexported fields
}

func (*SnowFlake) Generate

func (s *SnowFlake) Generate() int64

Jump to

Keyboard shortcuts

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