Documentation
¶
Index ¶
- func ByteToInterface(byteMsg []byte) (interface{}, error)
- func ByteToMap(msg []byte) (map[string]interface{}, error)
- func DecimalMath(str string) int32
- func FormatFloat(number float64, precision int) string
- func GenBase64Digest(h hash.Hash) string
- func GenHexDigest(h hash.Hash) string
- func GenerateOrderId(prefix string, length int) string
- func GenerateRangeNum(min, max int64) int64
- func HmacSha256(message string, secret string) hash.Hash
- func HmacSha512(message string, secret string) hash.Hash
- func IsoTime() string
- func JsonDecode(jsonBytes []byte, result interface{}) error
- func Microsec(t time.Time) int64
- func Millisec(t time.Time) int64
- func ParseFloat(str string) (float64, error)
- func ParseInt(str string) (int64, error)
- func RandomString(n int) string
- func RandomString64() string
- func ScaleFloat(number float64, precision int, roundUp string) float64
- func Sha512Str(src string) string
- func UrlEncodeParams(paramsDict map[string]interface{}) string
- func UrlEncodeParamsByKeys(paramsDict map[string]interface{}, keys []string) string
- type RandomStringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToInterface ¶
func FormatFloat ¶
func GenerateOrderId ¶
func GenerateRangeNum ¶
func HmacSha256 ¶
HmacSha256 计算Hmac Sha256签名串
func HmacSha512 ¶
HmacSha512 计算Hmac Sha512签名串
func JsonDecode ¶
func ParseFloat ¶
func UrlEncodeParams ¶
UrlEncodeParams 对query参数进行url编码,不要求参数顺序
func UrlEncodeParamsByKeys ¶
UrlEncodeParamsByKeys 对query参数进行url编码,根据传入的keys顺序进行处理
Types ¶
type RandomStringer ¶
type RandomStringer struct {
// contains filtered or unexported fields
}
RandomStringer 不加锁,使用者自己保证线程安全
func NewRandomStringer ¶
func NewRandomStringer() *RandomStringer
func (*RandomStringer) RandomString ¶
func (r *RandomStringer) RandomString(n int) string
RandomString 随机
func (*RandomStringer) RandomTracingID ¶
func (r *RandomStringer) RandomTracingID() string
Click to show internal directories.
Click to hide internal directories.