Generating unique, hard-to-guess “coupon” codes
问题 My Rails app needs to generate electronic coupons for users. Each coupon given should have a unique coupon code that can be redeemed on our system. For example a coupon for a free burrito. User A receives a coupon for a free burrito and then User B receives a coupon for a free burrito. The 2 coupons should have unique coupon codes. What is the best way to generate a code like this that is not easily forged? I don't want users to have a high success rate of typing in random numbers and