deprecated 함수 제거
This commit is contained in:
@ -44,17 +44,17 @@ func makeCouponKey(roundnum uint32, uid []byte) string {
|
||||
return fmt.Sprintf("%s-%s-%s-%s", hex.EncodeToString(final[0:2]), hex.EncodeToString(final[2:4]), hex.EncodeToString(final[4:6]), hex.EncodeToString(final[6:8]))
|
||||
}
|
||||
|
||||
var r = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
func makeCouponCodes(name string, count int) (string, map[string]string) {
|
||||
checkunique := make(map[string]bool)
|
||||
keys := make(map[string]string)
|
||||
uid := make([]byte, 4)
|
||||
|
||||
roundHash, roundnum := coupon.MakeCouponRoundHash(name)
|
||||
seed := time.Now().UnixNano()
|
||||
|
||||
for len(keys) < count {
|
||||
rand.Seed(seed)
|
||||
rand.Read(uid)
|
||||
r.Read(uid)
|
||||
|
||||
code := makeCouponKey(roundnum, uid)
|
||||
|
||||
@ -62,7 +62,6 @@ func makeCouponCodes(name string, count int) (string, map[string]string) {
|
||||
checkunique[code] = true
|
||||
keys[hex.EncodeToString(uid)] = code
|
||||
}
|
||||
seed = int64(binary.BigEndian.Uint32(uid))
|
||||
}
|
||||
return roundHash, keys
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user