Hacker News new | ask | show | jobs
by smaddock 1833 days ago
For those not in the know, 4242 is used as a common test card number.

https://stripe.com/docs/testing#cards

1 comments

I believe it comes from Hitchhiker's Guide to the Galaxy
Not entirely sure on the actual origins of this specific number but I think a crucial piece is that it passes the Luhn algorithm check [0] that is used to validate card numbers (and in generation of them to make single digit errors not result in another valid card number). 42 itself also passes the test but card numbers usually come in blocks of 4 digits so 4242 probably seems more card-like.

As to where the 42 from the Guide came from, I would recommend consulting The Hunting of the Snark.

[0] https://en.m.wikipedia.org/wiki/Luhn_algorithm