deprecated 함수 제거

This commit is contained in:
2023-08-31 17:24:21 +09:00
parent 76a4818a66
commit 0121310941
7 changed files with 85 additions and 147 deletions

View File

@ -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
}