1234567891011121314151617181920 |
- package main
- import (
- "crypto/md5"
- "encoding/hex"
- "fmt"
- "strconv"
- )
- func genDeviceIdentifier(vendor int32, product uint, device string) string {
- return strconv.FormatInt(int64(vendor), 16) + "-" + strconv.FormatInt(int64(product), 16) + "-" + device
- }
- // mdd md5加密
- func mdd(s string) string {
- h := md5.New()
- h.Write([]byte(s))
- cipherStr := h.Sum(nil)
- return fmt.Sprintf("%s", hex.EncodeToString(cipherStr))
- }
|