Documentation ¶
Index ¶
- func AesDecrypt(crypted, key []byte, iv []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte, iv []byte) ([]byte, error)
- func Bool2Int(value bool) int
- func ByteFormat(size int64) string
- func CheckPhone(tel string) bool
- func Crmd5(s string) string
- func DurationFormat(ns int64) string
- func EscapeQuots(val string) string
- func FormatTime(t time.Time) string
- func FormatTimeUnix(t int64) string
- func GetTimeByDuration(days float64) time.Time
- func GetTimeZero(t time.Time) int64
- func InArray(arrs []interface{}, value interface{}, ...) bool
- func InStringArray(arrs []string, value string, equalMethod func(string, string) bool) bool
- func IsEmpty(val string) bool
- func JudgeSmallThenToday(t int64) bool
- func Log(info interface{}, prefix string)
- func MD5(data string) string
- func MonthCount(year int, month int) (days int)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) ([]byte, error)
- func PrecFloat64(f float64, p int) float64
- func RandomFloat64(min, max float64, p int) float64
- func RandomSpec(count uint, start, end int, letters, numbers bool, chars []rune) string
- func RemoveDuplicatesInt64(elements []int64) []int64
- func SHA1(data string) string
- func SendMail(mailInfo MailInfo)
- func Str2Float(s string) float64
- func Str2Int(s string) int
- func Str2Int64(s string) int64
- func Str2Uint(s string) uint
- func SubstrByByte(str string, length int) string
- func TinyNo() string
- func ToFloat32(value interface{}) (float32, error)
- func ToFloat64(value interface{}) (float64, error)
- func ToInt(value interface{}) (int, error)
- func ToInt32(value interface{}) (int32, error)
- func ToInt64(value interface{}) (int64, error)
- func ToString(args ...interface{}) (string, error)
- func U82Str(value interface{}) string
- func U8sFloat64(value interface{}) float64
- func U8sInt(value interface{}) int
- func WhenNil(value interface{}, nilReturn interface{}, okReturn interface{}) interface{}
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type Dfa
- type MailInfo
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt AES 解密 @origData 加密的原始数据 @key 密钥 @iv 向量
func AesEncrypt ¶
AesEncrypt AES 加密 @origData 加密的原始数据 @key 密钥 @iv 向量
func ByteFormat ¶
ByteFormat returns a human-readable string representation of a byte count
func DurationFormat ¶
DurationFormat returns a human-readable string representation of nanosecond number
func GetTimeByDuration ¶
GetTimeByDuration 根据间隔获取指定时间
func InArray ¶
func InArray(arrs []interface{}, value interface{}, equalMethod func(interface{}, interface{}) bool) bool
InArray 判断一个值是否存在于数组当中 @arrs 要判断的数组 @value 要判断的值
func InStringArray ¶
InStringArray 判断是否在String数组里面 @arrs @value
func JudgeSmallThenToday ¶
JudgeSmallThenToday 判断是否为小于今天的时间 @time 要判断的时间
func RandomFloat64 ¶
RandomFloat64 随机生成64位小数 @min 最小值 @max 最大值 @p 小数精度
func RandomSpec ¶
RandomSpec Creates a random string based on a variety of options, using supplied source of randomness.
If start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32.
If set is not nil, characters between start and end are chosen.
This method accepts a user-supplied rand.Rand instance to use as a source of randomness. By seeding a single rand.Rand instance with a fixed seed and using it for each call, the same random sequence of strings can be generated repeatedly and predictably.
func RemoveDuplicatesInt64 ¶
RemoveDuplicatesInt64 删除重复元素
Types ¶
type Dfa ¶
type Dfa struct {
// contains filtered or unexported fields
}
Dfa DFA 算法
func (*Dfa) FilterWords ¶
FilterWords 过滤关键词 @text 输入文本 @replaceChar 替换的字符