Documentation ¶
Index ¶
- Constants
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func FloatToInt(f float64) int64
- func FloatToString(f float64) string
- func GenRsaKey(bits int) error
- func InsertByte(source []byte, i uint8, idx int64) []byte
- func IntDateFmt(date int64, inFmt string, outFmt string) string
- func IntToFloat(i int64) float64
- func IntToString(i int64) string
- func IsDate(fmt, str string) bool
- func Max(first float64, rest ...float64) float64
- func Min(first float64, rest ...float64) float64
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func RandInt(max int64, min int64) int64
- func RandIntString(n int) string
- func RandLowcase(n int) string
- func RandMix(n int) string
- func RandString(n int, num bool, lowcase bool, upcase bool) string
- func RandUpcase(n int) string
- func Regexp(pattern string, s string) bool
- func RsaDecrypt(ciphertext []byte) ([]byte, error)
- func RsaEncrypt(data []byte) ([]byte, error)
- func RsaSign(data []byte) ([]byte, error)
- func RsaSignVer(data []byte, signature []byte) error
- func StringDateFmt(date, inFmt, outFmt string) string
- func StringToFloat(s string) float64
- func StringToFloatDecimal(s string, exp int32) float64
- func StringToInt(s string) int64
- func StringsContains(array []string, s string) bool
- func StructToMap(item interface{}) map[string]interface{}
- func UnixString() string
Constants ¶
View Source
const ( Day = time.Hour * 24 DaySecond = Day / time.Second Month = Day * 30 MonthSecond = DaySecond * 30 Year = Month * 365 YearSecond = MonthSecond * 365 RegexpPatternEmail = "[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?" RegexpPatternMobile = "^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8])|(19)[0-9])\\d{8}$" TIMESTAMPZONE = "2006-01-02 15:04:05.999999999 -0700" YYYYMMDDHHMMSS = "2006-01-02 15:04:05" YYYYMMDDHHMM = "2006-01-02 15:04" YYYYMMDDHH = "2006-01-02 15" YYYYMMDD = "2006-01-02" HHMMSS = "15:04:05" HHMM = "15:04" MMSS = "04:05" YYYY = "2006" MM1 = "01" DD = "02" HH = "15" MM2 = "04" SS = "05" )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func FloatToInt ¶
func FloatToString ¶
func IntToFloat ¶
func IntToString ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func RandIntString ¶
func RandLowcase ¶
func RandUpcase ¶
func StringDateFmt ¶
func StringToFloat ¶
func StringToFloatDecimal ¶
func StringToInt ¶
func StringsContains ¶ added in v0.5.0
func StructToMap ¶ added in v0.3.1
func StructToMap(item interface{}) map[string]interface{}
func UnixString ¶
func UnixString() string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.