The title really looks weird to me right now, but that is the truth. I have started many posts since the last published post but I was not able to carry the same motivation with which I started them and that resulted into an increment to the number of drafts on my blog (I hope this one goes through).
Anyways, a lot has changed since my last post on March 7th. I am no more working with any company and I am not living with my family anymore. This doesn’t mean that I am jobless and homeless but I have moved to Germany and this is why I had to quit from my job in Karachi.
I have come to the beautiful and small city of Weimar for my Masters. After working as a Software Engineer for 3 years I have now started my M.Sc. in Computer Science and Media from Bauhaus Universität, Weimar. It has been more than 2 months now, and I have experienced many things that I shall write about (very soon). I think such experiences are worth sharing like my first international flight, the unexpected warm welcome by a bunch of great Pakistanis already in Weimar, my observations about Germany and comparisons of similar things in Pakistan, my trip to Hamburg and a few more. I am hoping to gather enough motivation next time to start writing all these.
Almost all credit card numbers used are generated using Luhn’s algorithm. Luhn’s algorithm is a simple checksum formula to validate variety of numbers. We can use the same formula for checking whether a given credit card number may be valid or not.
This can be used as a good technique to validate the credit card number in your web application. I found a simple function which validates any given number according to Luhn’s formula and gives the result to be true or false. The function is implemented in PHP and the primary source of this function is here.
This small function is very useful if you want to check the validity of the credit card number being provided before passing it to your payment mechanism.
Sample Credit Card Numbers for testing
When I implemented this in my code, I also wanted to have some sample credit card numbers to test this. Sample credit card numbers are also very useful in many cases so here are the credit card numbers that I found.
Credit Card Type
Credit Card Number
American Express Corporate
4222222222222Note : Even though this number has a different character count than the other test numbers, it is the correct and functional number.