Commit 797c55e1253cad35c48b77c2928b4013f169c9d5

Authored by 陆恒
1 parent 2d7fb980

提交

Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
src/HttpServer/logic/function.go
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 "bytes" 6 "bytes"
7 "common/logger" 7 "common/logger"
8 "common/redis" 8 "common/redis"
9 - "crypto/sha1" 9 + "crypto/md5"
10 "encoding/hex" 10 "encoding/hex"
11 "encoding/json" 11 "encoding/json"
12 "errors" 12 "errors"
@@ -777,11 +777,13 @@ func GettotalParam(paramlist []string) string { @@ -777,11 +777,13 @@ func GettotalParam(paramlist []string) string {
777 } 777 }
778 778
779 func GetHashValue(signsum string) string { 779 func GetHashValue(signsum string) string {
780 - h := sha1.New() 780 + /*h := sha1.New()
781 h.Write([]byte(signsum)) 781 h.Write([]byte(signsum))
782 bs := h.Sum(nil) 782 bs := h.Sum(nil)
783 - sign := hex.EncodeToString(bs)  
784 - return sign 783 + sign := hex.EncodeToString(bs)*/
  784 + ctx := md5.New()
  785 + ctx.Write([]byte(signsum))
  786 + return hex.EncodeToString(ctx.Sum(nil))
785 } 787 }
786 788
787 func DoHttpPost(bys []byte, apistr string) (string, error) { 789 func DoHttpPost(bys []byte, apistr string) (string, error) {