util.go 466 B

12345678910111213141516171819202122232425
  1. package util
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
  5. "crypto/md5"
  6. "encoding/hex"
  7. )
  8. // sha1 加密
  9. func GetHashKey(bs []byte) string {
  10. defer common.Catch()
  11. //ha := sha256.New()
  12. //ha.Write(bs)
  13. //hbs := ha.Sum(nil)
  14. //key := fmt.Sprintf("%x", hbs)
  15. //return key
  16. hash := md5.Sum(bs)
  17. return hex.EncodeToString(hash[:])
  18. }
  19. // 创建订单号
  20. func GetOrderCode() string {
  21. return <-jy.VarOrderCode.Pool
  22. }