What\'s the best way to generate unique codes to use as coupon codes?
Thanks.
In Ruby's standard library there is SecureRandom for this:
SecureRandom
SecureRandom.hex(3)
The length of the output is double of what the length input specified.