Documentation ¶
Index ¶
- Constants
- Variables
- func AESCBCDecrypt(cipherData, key, iv []byte) ([]byte, error)
- func AESCBCEncrypt(rawData, key, iv []byte) ([]byte, error)
- func AESECBDecrypt(buf, key []byte) ([]byte, error)
- func AESECBEncrypt(data, key []byte) ([]byte, error)
- func AsyncFunc(fn func())
- func AsyncFuncGroup(fns ...func())
- func Base64Decode(str string) []byte
- func Base64Encode(buf []byte) string
- func Base64UrlDecode(str string) []byte
- func Base64UrlEncode(buf []byte) string
- func BaseXDecoding(strByte []byte, key ...string) []byte
- func BaseXEncoding(strByte []byte, key ...string) string
- func BigIntAdd(num1 string, num2 string) string
- func BigIntCmp(num1 string, num2 string) int
- func BigIntDiv(num1 string, num2 string) string
- func BigIntMod(num1 string, num2 string) string
- func BigIntMul(num1 string, num2 string) string
- func BigIntReduce(num1 string, num2 string) string
- func Camel2Case(str string) string
- func CaptchaGet(width, height int) map[string]string
- func CaptchaVerify(id, code string) bool
- func Case2Camel(str string) string
- func Code2Id(code string) (int64, error)
- func DIR() string
- func Date2Ts(date string) int64
- func DateTime(format string) string
- func DateTime2Ts(dateTime string) int64
- func FILE() string
- func GBK2UTF8(s string) string
- func GenId() int64
- func GenIdInit(adapter iGenId)
- func GenIdStr() string
- func HMacMd5(buf, key []byte) string
- func HMacSha1(buf, key []byte) string
- func HMacSha256(buf, key []byte) string
- func Id2Code(id int64) string
- func JWTTokenCreate(data map[string]interface{}, header map[string]interface{}, ...) (string, error)
- func JWT_TokenParse(signedToken string, publicKeyByte []byte) (*jwt.Token, error)
- func LINE() int
- func MD5(buf []byte) string
- func NewIdCode(key string) *idCode
- func NextDate(d int) string
- func NonceStr() string
- func NonceStr8() string
- func Now() string
- func PinYin(origin string) (string, error)
- func RSA_SHA256() (privateKeyBytes []byte, publicKeyBytes []byte, jwkBytes []byte, err error)
- func Recovery()
- func SHA1(buf []byte) string
- func SHA256(buf []byte) string
- func SHAWithRSA(key, data []byte) (string, error)
- func SessionId() string
- func Slice2UniqFloat32s(x any, f func(i int) float32) (data []float32)
- func Slice2UniqFloat64s(x any, f func(i int) float64) (data []float64)
- func Slice2UniqInt32s(x any, f func(i int) int32) (data []int32)
- func Slice2UniqInt64s(x any, f func(i int) int64) (data []int64)
- func Slice2UniqInts(x any, f func(i int) int) (data []int)
- func Slice2UniqStrings(x any, f func(i int) string) (data []string)
- func SliceHas(x any, f func(i int) bool) bool
- func SliceMap(x any, f func(i int))
- func Split(s string, rs ...rune) []string
- func SplitArray(arr []interface{}, size int) (list [][]interface{})
- func SplitInt64Array(arr []int64, size int) (list [][]int64)
- func SplitIntArray(arr []int, size int) (list [][]int)
- func SplitStringArray(arr []string, size int) (list [][]string)
- func Str2Time(str string) (ti time.Time, err error)
- func Template(text string, data interface{}) (string, []interface{}, error)
- func Today() string
- func Trace(skip int) (arr []string)
- func Ts2Date(ts int64) string
- func Ts2DateTime(ts int64) string
- func UTF82GBK(s string) string
- func UUID() string
- func ValidPassword(str string) (msg string, matched bool)
- func ValidPasswordV2(str string) (msg string, matched bool)
- func WriteToFile(filename string, b []byte) error
- type Byte
- type Float64
- type M
- type Mode
- type Params
- func (p Params) Array() (ps []Params)
- func (p Params) ArrayData() []interface{}
- func (p Params) Bool() bool
- func (p Params) Data() interface{}
- func (p Params) Float32() float32
- func (p Params) Float64() float64
- func (p Params) Get(key string) Params
- func (p Params) Int() int
- func (p Params) Int32() int32
- func (p Params) Int64() int64
- func (p Params) JSON() []byte
- func (p Params) Map() (rst map[string]Params)
- func (p Params) MapData() map[string]interface{}
- func (p Params) Set(key string, val interface{}) Params
- func (p Params) String() string
- type SnowFlakeId
- type StringMap
Constants ¶
View Source
const (
EL = "\n"
)
Variables ¶
View Source
var (
ErrInitialize = errors.New("not yet initialized")
)
Functions ¶
func AESCBCDecrypt ¶
func AESCBCEncrypt ¶
func AESECBDecrypt ¶
func AESECBEncrypt ¶
func Base64Decode ¶
func Base64Encode ¶
func Base64UrlDecode ¶ added in v1.1.165
func Base64UrlEncode ¶ added in v1.1.165
func BaseXDecoding ¶ added in v1.1.112
func BaseXEncoding ¶ added in v1.1.112
如果遇到特殊字符,需要用 url.PathEscape(str) 解决
func DateTime2Ts ¶
func HMacSha256 ¶
func JWTTokenCreate ¶ added in v1.1.165
func JWT_TokenParse ¶ added in v1.1.165
func RSA_SHA256 ¶ added in v1.1.165
生成私钥、公钥、jwk公钥描述文件
func SHAWithRSA ¶
func Slice2UniqFloat32s ¶ added in v1.1.167
func Slice2UniqFloat64s ¶ added in v1.1.167
func Slice2UniqInt32s ¶ added in v1.1.167
func Slice2UniqInt64s ¶ added in v1.1.167
func Slice2UniqStrings ¶ added in v1.1.167
func SplitArray ¶ added in v1.1.57
func SplitArray(arr []interface{}, size int) (list [][]interface{})
func SplitInt64Array ¶ added in v1.1.57
func SplitIntArray ¶ added in v1.1.57
func SplitStringArray ¶ added in v1.1.57
func Ts2DateTime ¶
func ValidPassword ¶ added in v1.1.70
func ValidPasswordV2 ¶ added in v1.1.70
Types ¶
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func Json2Params ¶ added in v1.1.91
type SnowFlakeId ¶ added in v1.0.63
type SnowFlakeId struct {
// contains filtered or unexported fields
}
雪花算法
func (*SnowFlakeId) GenId ¶ added in v1.0.63
func (sf *SnowFlakeId) GenId() int64
Click to show internal directories.
Click to hide internal directories.