|
|
@ -4,11 +4,22 @@ import (
|
|
|
|
"crypto/hmac"
|
|
|
|
"crypto/hmac"
|
|
|
|
"crypto/sha256"
|
|
|
|
"crypto/sha256"
|
|
|
|
"encoding/hex"
|
|
|
|
"encoding/hex"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"unicode/utf8"
|
|
|
|
"unicode/utf8"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Version = "1.0.1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ToString 转换成string
|
|
|
|
|
|
|
|
func ToString(value interface{}) string {
|
|
|
|
|
|
|
|
if value == nil {
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprint(value)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ToFloat64 string到float64
|
|
|
|
// ToFloat64 string到float64
|
|
|
|
func ToFloat64(s string) float64 {
|
|
|
|
func ToFloat64(s string) float64 {
|
|
|
|
i, _ := strconv.ParseFloat(s, 64)
|
|
|
|
i, _ := strconv.ParseFloat(s, 64)
|
|
|
|