I require 100,000 x 16 digit card numbers each random. The numbers should begin as 3965 - #### - #### -###0
Akin to checksum. The algorithm used to arrive at the proper check digit is called the ‘Luhn Algorithm’, after IBM scientist Hans Peter Luhn, (patent no 2950048 computer for Verifying Numbers).
Card with an even number of digits, double every odd numbered digit and subtract 9, if the product is greater than 9. Add up all the even digits as well as the doubled-odd digits, and the result must be a multiple of 10 or it’s not a valid card.
Card with an odd number of digits, perform the same addition doubling the even numbered digits instead.
The bit about odd and even is a little confusing. The main point is that you don’t want to double the check digit, and this can be done by starting with the check digit, going backwards, and doubling every other digit.