|
@ -2,6 +2,7 @@ package util |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"crypto/md5" |
|
|
"crypto/md5" |
|
|
|
|
|
"fmt" |
|
|
"io" |
|
|
"io" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -91,3 +92,9 @@ func HashToInt32(data []byte) (v int32) { |
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func Md5(data []byte) string { |
|
|
|
|
|
hash := md5.New() |
|
|
|
|
|
hash.Write(data) |
|
|
|
|
|
return fmt.Sprintf("%x", hash.Sum(nil)) |
|
|
|
|
|
} |