|
|
@@ -10,7 +10,6 @@ import (
|
|
|
"crypto/md5"
|
|
|
"crypto/sha1"
|
|
|
"encoding/hex"
|
|
|
- "fmt"
|
|
|
"hash"
|
|
|
"sort"
|
|
|
)
|
|
|
@@ -35,15 +34,11 @@ func Sign(parameters map[string]string, apiKey string, fn func() hash.Hash) stri
|
|
|
h := fn()
|
|
|
|
|
|
buf := make([]byte, 256)
|
|
|
- fmt.Printf("begin------")
|
|
|
for _, k := range ks {
|
|
|
v := parameters[k]
|
|
|
if v == "" {
|
|
|
continue
|
|
|
}
|
|
|
-
|
|
|
- fmt.Printf("map---%s=>%s\n", k, v)
|
|
|
-
|
|
|
buf = buf[:0]
|
|
|
buf = append(buf, k...)
|
|
|
buf = append(buf, '=')
|
|
|
@@ -51,9 +46,7 @@ func Sign(parameters map[string]string, apiKey string, fn func() hash.Hash) stri
|
|
|
buf = append(buf, '&')
|
|
|
h.Write(buf)
|
|
|
}
|
|
|
- fmt.Printf("end------")
|
|
|
buf = buf[:0]
|
|
|
-
|
|
|
buf = append(buf, "key="...)
|
|
|
buf = append(buf, apiKey...)
|
|
|
h.Write(buf)
|