I am in need of generating 10 character unique codes, containing both letters and digits, to be utilized for system generated gift vouchers. Currently, the code I am using includes 13 numbers.
var today = new Date();
Number(today);
Is there a different method available to generate 10 digit unique codes for the system generated gift vouchers? The generated codes should never be the same at any given time. I am looking for a way to generate codes similar to the _id field in the meteor collection. What would be the most effective way to accomplish this?
In meteor, unique ids are generated for records. I am seeking a solution to create a 10 digit unique value in the same manner.