Menu

Card numbers for loyalty and gift cards: Luhn check digits, sequential vs random, and the CSV the printer needs
📰

Card numbers for loyalty and gift cards: Luhn check digits, sequential vs random, and the CSV the printer needs

DEV Community: javascript·Allan Hall·about 17 hours ago
#MsrBjPBW
#devtojavascript#devto#dev#card#number
Reading 0:00
15s threshold

If you are building a loyalty, gift or membership card system, you will have to decide what number goes on each card before anything is printed. That number ends up in your database, in a barcode, maybe on a magnetic stripe, and on the face of the card where staff type it in by hand. A few choices made early save a lot of trouble later.

Sequential or random?

Sequential numbers (000001, 000002, ...) are easy to print, easy to check for gaps, and fine for membership cards where the number is only an identifier and the card has no value.

Random numbers are better when the card carries value (gift cards, prepaid balances, loyalty points that can be redeemed). If numbers are sequential, someone holding card 000500 can guess that 000501 exists.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.