1234567891011121314151617181920212223 |
- package util
- import (
- "app.yhyue.com/moapp/jybase/common"
- "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
- "crypto/sha256"
- "fmt"
- )
- // sha1 加密
- func GetHashKey(bs []byte) string {
- defer common.Catch()
- ha := sha256.New()
- ha.Write(bs)
- hbs := ha.Sum(nil)
- key := fmt.Sprintf("%x", hbs)
- return key
- }
- // 创建订单号
- func GetOrderCode(name string) string {
- return fmt.Sprintf("%s-%s", name, <-jy.VarOrderCode.Pool)
- }
|