What algorithm is used by banks for generating random numbers like(credit cards/debit cards numbers) ?
Suppose i maintain all the numbers in DB and If i try the below approach,
- Generate a random number.
- Verify whether the number has been already assigned.
- If yes goto step 1.
- If no create a record in DB for the new number and output the result.
It will ask for more db hits when the card volume increases.
Any other take on this ?? Please help.