They uses many algorithms which is available on many open source platforms. Also credit card generator sites uses fake details to generate that details. One of them I'm using is https://www.cardgenerators.com/credit-card-generator/ and also you can verify your card using credit card validator on their website. Hope this will help you. Make sure to read more about Luhn Algorithm too.
... View more