I need to generate 10 characters(both letters and digits) unique codes to apply for system generated gift vouchers. currently, I'm using following code.But it contains 13 numbers.
var today = new Date();
Number(today);
Is there is any other way to create 10 digit unique values to apply system generated gift vouchers.It should never same at any time.Code should be generated like in _id in meteor collection.What is the best possible way to do this?
In meteor it generates an unique id for records.Like that I need to create a 10 digit unique value