Documentation ¶
Index ¶
- Variables
- func AddSecondToTime(second int64) (timestamp int64, Time time.Time, timeStr string)
- func AesDecrypt(encrypted []byte, key []byte) ([]byte, error)
- func AesDecryptBase64(str, key string) (string, error)
- func AesEncrypt(origData []byte, key []byte) ([]byte, error)
- func AesEncryptBase64(str, key string) (string, error)
- func AfterDayTime(day int) (timestamp int64, Time time.Time, timeStr string)
- func BeforeDayTime(day int) (timestamp int64, Time time.Time, timeStr string)
- func CheckEmailRule(email string) bool
- func CheckIdNumRule(idNum string) bool
- func CheckIdNumRuleSimple(idNum string) bool
- func CheckMobileNumRule(mobile string) bool
- func CheckStringLength(str string, length int) bool
- func CreateOrderNo() (sn string)
- func DiyTimeFmtStr(format string, timestamps ...int64) string
- func DownInt(f float64) float64
- func Float32ToString(f float64) string
- func Float64ToString(f float64) string
- func FloatRound(f float64, n int) (res float64, err error)
- func InSlice(slice []string, target string) bool
- func Int64ToInt(i64 int64) int
- func Int64ToString(i64 int64) string
- func InterceptDecimal(f float64, n int) float64
- func InterceptDecimalToString(f float64, n int) string
- func Md5(str string) string
- func NowDateTime() time.Time
- func NowDateTimeFmtStr() string
- func NowDateTimeStr() string
- func NowTime() (timestamp int64, Time time.Time, timeStr string)
- func NowTimeSplit() (ymd, hms string)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) ([]byte, error)
- func RandString() string
- func RoundFloat(f float64, n int) (res float64, err error)
- func RoundToString(f float64, n int) string
- func Sha1(str string) string
- func SpellReadNum(str string) (slice []string, err error)
- func StrLengthCutAndSplitJoint(str string, cutLength int, splitJointStr ...string) string
- func StrToInt64(str string) (int64, error)
- func StringToFloat64(s string) (float64, error)
- func TimeSplit(t time.Time) (ymd, hms string)
- func TimeStrToTime(str string) (timestamp int64, Time time.Time)
- func TimestampToTime(timestamp int64) (Time time.Time, timeStr string)
- func ToBigCamelCase(str string, signs ...string) (res string)
- func ToSmallCamelCase(str string, signs ...string) (res string)
- func TodayDateTimeEnd() (timestamp int64, Time time.Time, timeStr string)
- func TodayDateTimeStart() (timestamp int64, Time time.Time, timeStr string)
- func UpInt(f float64) float64
- func UrlDecode(str string) (url string)
- func UrlEncode(url string) string
Constants ¶
This section is empty.
Variables ¶
var ( TimeLayout string = "2006-01-02 15:04:05" TimeLayoutYMD string = "2006-01-02" TimeLayoutHMS string = "15:04:05" )
Functions ¶
func AddSecondToTime ¶ added in v0.0.3
AddSecondToTime 在当前时间戳的基础上加上秒数,重新生成时间日期
func AesDecrypt ¶ added in v0.0.6
AesDecrypt AES解密
func AesDecryptBase64 ¶ added in v0.0.6
AesDecryptBase64 对Base64格式的字符串解密
func AesEncrypt ¶ added in v0.0.6
AesEncrypt AES加密
func AesEncryptBase64 ¶ added in v0.0.6
AesEncryptBase64 加密后为Base64格式的字符串
func AfterDayTime ¶ added in v0.1.3
AfterDayTime N天后的时间
func BeforeDayTime ¶ added in v0.0.17
BeforeDayTime N天前的时间
func CheckIdNumRule ¶ added in v0.0.2
CheckIdNumRule 验证身份证号码的合法性
func CheckIdNumRuleSimple ¶ added in v0.0.19
CheckIdNumRuleSimple 简单校验身份证号码的位数+组成字符
func CheckMobileNumRule ¶ added in v0.0.2
CheckMobileNumRule 验证手机号码
func CheckStringLength ¶ added in v0.0.14
CheckStringLength 判断字符串长度是否在规定范围内
func DiyTimeFmtStr ¶ added in v0.1.2
DiyTimeFmtStr Diy时间格式
func Float32ToString ¶ added in v0.0.2
Float32ToString float32转string
func Float64ToString ¶ added in v0.0.2
Float64ToString float64转string
func FloatRound ¶ added in v0.2.2
FloatRound 四舍五入 [n为保留的小数点位数] [不优先使用]
func Int64ToString ¶ added in v0.0.2
Int64ToString int64转string
func InterceptDecimal ¶ added in v0.2.2
InterceptDecimal 不四舍五入截取小数点 [n为保留的小数点数]
func InterceptDecimalToString ¶ added in v0.2.5
InterceptDecimalToString 不四舍五入截取小数点后为字符串格式 [n为保留的小数点数]
func PKCS7Padding ¶ added in v0.0.6
PKCS7Padding PKCS7 填充模式
func PKCS7UnPadding ¶ added in v0.0.6
PKCS7UnPadding 填充的反向操作,删除填充字符串
func RoundFloat ¶ added in v0.2.2
RoundFloat 四舍五入 [n为保留的小数点位数] [优先使用]
func RoundToString ¶ added in v0.2.5
RoundToString 四舍五入后为字符串格式 [n为保留的小数点位数]
func SpellReadNum ¶ added in v0.0.18
SpellReadNum 拼读数
func StrLengthCutAndSplitJoint ¶ added in v0.0.13
StrLengthCutAndSplitJoint 字符串长度截取并拼接处理
func StrToInt64 ¶ added in v0.0.2
StrToInt64 string转int64
func StringToFloat64 ¶ added in v0.2.7
StringToFloat64 string转float64
func TimeStrToTime ¶ added in v0.0.2
TimeStrToTime 将时间字符串转为时间戳和time.Time(例如:2021-08-08 08:08:08)
func TimestampToTime ¶ added in v0.0.4
TimestampToTime 时间戳转日期格式
func ToBigCamelCase ¶ added in v0.2.4
ToBigCamelCase 字符串转大驼峰格式
func ToSmallCamelCase ¶ added in v0.2.4
ToSmallCamelCase 字符串转小驼峰格式
func TodayDateTimeEnd ¶ added in v0.2.0
TodayDateTimeEnd 今日23:59:59时间
func TodayDateTimeStart ¶ added in v0.2.0
TodayDateTimeStart 今日00:00:00时间
Types ¶
This section is empty.