Sunday, June 11, 2006

Credit Card Validation - Check Digits

This article outlines procedures and algorithms for Verifying the accuracy and validity of credit card numbers. Most credit card numbers are encoded with a "Check Digit". A check digit is a digit added to a number (either at the end or the beginning) that validates the authenticity of the number. A simple algorithm is applied to the other digits of the number which yields the check digit. By running the algorithm, and comparing the check digit you get from the algorithm with the check digit encoded with the credit card number, you can verify that you have correctly read all of the digits and that they make a valid combination.

Possible uses for this information:

  • When a user has keyed in a credit card number (or scanned it) and you want to validate it before sending it our for debit authorization.
  • When issuing cards, say an affinity card, you might want to add a check digit using the MOD 10 method.

1.Prefix, Length, and Check Digit Criteria

Here is a table outlining the major credit cards that you might want to validate.

Check digit algorithm
MASTERCARD 51-55 16 mod 10
VISA 4 13, 16 mod 10
15 mod 10
Diners Club/
Carte Blanche
14 mod 10
Discover 6011 16 mod 10
enRoute 2014
15 any
JCB 3 16 mod 10
JCB 2131
15 mod 10

2. LUHN Formula (Mod 10) for Validation of Primary Account Number

The following steps are required to validate the primary account number:

Step 1: Double the value of alternate digits of the primary account number beginning with the second digit from the right (the first right--hand digit is the check digit.)

Step 2: Add the individual digits comprising the products obtained in Step 1 to each of the unaffected digits in the original number.

Step 3: The total obtained in Step 2 must be a number ending in zero (30, 40, 50, etc.) for the account number to be validated.

For example, to validate the primary account number 49927398716:

Step 1:

        4  9   9  2  7  3  9  8  7  1  6
x2 x2 x2 x2 x2
18 4 6 16 2

Step 2: 4 +(1+8)+ 9 + (4) + 7 + (6) + 9 +(1+6) + 7 + (2) + 6

Step 3: Sum = 70 : Card number is validated

Note: Card is valid because the 70/10 yields no remainder.

The great folks at ICVERIFY are the original source of this data, I only formatted it in HTML.

Here is an Microsoft Excel worksheet that will validate a number for you (useful for understanding the algorithm, it is in a .ZIP compressed format)

Make sure that you:

  1. have started with the rightmost digit (including the check digit) (figure odd and even based upon the rightmost digit being odd, regardless of the length of the Credit Card.) ALWAYS work right to left.
  2. the check digit counts as digit #1 (assuming that the rightmost digit is the check digit) and is not doubled
  3. double every second digit (starting with digit # 2 from the right)
  4. remember that when you double a number over 4, (6 for example) you don't add the result to your total, but rather the sum of the digits of the result (in the above example 6*2=12 so you would add 1+2 to your total (not 12).
  5. always include the Visa or M/C/ prefix.

Sunday, June 04, 2006

GMail Beta vs. Yahoo! Beta vs. Hotmail Beta

Which Web-based e-mail service should you use? It depends on your personal taste, of course, but a clean page layout, speed, and security are paramount. For now, the next-generation editions of Yahoo Mail, Gmail, and Hotmail are still works in progress and not widely available. You can get a Gmail account today either by sending a request via mobile phone or getting another user to invite you, but you'll need to join a waiting list in order to try the Yahoo Mail beta or the Windows Live Mail beta.

Yahoo Mail, based on the former Oddpost client, was the first to bring a drag-and-drop, Outlook-style layout to online e-mail. It arranges messages in tabs to help you multitask.
We found only one other Web 2.0 e-mail experience worth mentioning: 37signals' Backpack is a neat hybrid of e-mail, personal publishing, and to-do lists. However, we found Backpack too awkward to serve as a primary e-mail account, and you have to pay to access the full features.

The trio of big-brand, beta e-mail services offers more features than do the classic, nonbeta versions of Yahoo Mail and Hotmail that you may use today, but if you itch to switch, there's no easy way to import and export messages and contacts from one e-mail brand to another. We've been toying with these three beta tools through several iterations, and we expect more changes as their makers compete and respond to testers' requests.


Using AJAX technologies, all of these e-mail apps load messages in a snap because they don't have to reload an entire HTML page with each mouse click. Yahoo Mail and Windows Live Mail mimic the dual-pane layout of Microsoft Outlook, which squeezes more text onto a screen than online e-mail apps have in the past. Yet only Yahoo's tabbed messaging makes it possible to keep track of multiple messages at once or to interrupt your work and return to it later.

While the Outlook-style interface is familiar to users of desktop e-mail clients, we're fans of the uncluttered Gmail, with its copious white space and rounded edges. Gmail's single-click functions demand less dragging and dropping, so your hands can rest, but only Gmail lacks right-mouse-click functions. All three services do offer keyboard shortcuts.

If you've ditched Internet Explorer and are now using an alternative Internet browser, you'll appreciate Yahoo Mail and Gmail; both work with Firefox, Opera, and others. Windows Live Mail beta works with multiple browsers, but its spell check only works with Internet Explorer.

Gmail presents just as much information as its rivals do but looks less cluttered.


We found Gmail to be the speediest online e-mail service; our messages seemed to appear the instant we clicked on a header. Delays of up to several seconds occasionally marred our experience with the betas of Windows Live Mail and especially Yahoo Mail.


Who wants a commercial break within their personal e-mail service? Only the paid version of Yahoo Mail is completely ad-free. Both Yahoo and Windows Live Mail display distracting, animated, graphical ads, while Gmail discreetly displays text ads based on the content of your e-mail messages. Google says that no human actually reads your Gmail, yet we find it uncanny to see paid suggestions for investment, travel, medicine, and more next to inbound messages about the same subjects.

Animated banner ads mar the appearance of Windows Live Mail.

Organizing content

By allowing you to drag and drop messages into folders, Yahoo and Windows Live spare you the manual labor of using a tiny check box to move content around. But Yahoo and Microsoft Live both display mail within a list of noncollapsible folders, which can get a bit unwieldy over time.

On the other hand, Gmail lets you organize content by tagging it with Labels; further, you can collapse the list of Labels along the left edge of the screen at any time. Gmail's filtering options go one step further than its rivals, letting you designate messages for an automatic Label or Star or to be archived, forwarded, or deleted. We set similar filters within Yahoo Mail, yet it failed to route messages from family members into the Family folder we'd designated.

If you're unlikely to organize your e-mail into labels or folders, you'll be at the mercy of built-in search tools to retrieve a must-have message. Yahoo Mail and Gmail not only let you search through messages, you can also look within attachments; Windows Live Mail sifts only through message text.

Finally, if you never delete e-mail, you'll appreciate that Gmail gives you a whopping 2.65GB of storage. Windows Live Mail comes a close second, offering 2GB, with Yahoo Mail trailing at a meager 1GB. Windows Live, Yahoo and Gmail will keep your saved messages indefinitely.

Windows Live Mail warns you of potential phishing threats in a clearly labeled banner atop each message.


If spam is the scourge of your e-mail, then you'll want to wipe it from your in-box. So far we prefer Windows Live Mail's approach to spam and other threats. It displays a banner atop every message that either allows you to accept or reject a sender and further warns you of potential phishing scams based on an analysis of the e-mail's sender address. Gmail and Yahoo Mail both offer spam and virus filters, but neither make your options so obvious.

Services integration

Yahoo, Microsoft and Google all connect their e-mail apps to their own IM, calendars, and other tools to keep you from clicking elsewhere. Yahoo and Microsoft's e-mail betas offer contact sharing and instant links to their instant messaging and calendar apps. But Gmail provides the most sophisticated cross-integration; for example, the Google Talk beta IM client allows you to chat within a Gmail page and view transcripts of sessions there. Beyond that, Gmail's natural-language capabilities flag potential appointments for scheduling on the Google Calendar beta and display a Google Maps link whenever it recognizes an address.

Yahoo Mail is the only one of these three e-mail services that lets you read lots of news via RSS feeds alongside your in-box.

All three e-mail services include hand-picked RSS feeds, but here Yahoo has made the most progress. Yahoo Mail organizes your newsfeeds into folders below your in-box, similar to the way RSS reader NewsGator works within Outlook. We like that you can collapse or expand the Yahoo RSS folder and view a headline and story summary or a full blog post without jumping to another page or opening another browser window. Gmail's Web Clips component displays a single story from an RSS or Atom feed above your in-box, but clicking it opens a new browser window. Yet unlike Yahoo Mail, Gmail lets you search by topic to add new feeds. Microsoft is planning to incorporate RSS feeds into Windows Live Mail, but its beta currently lacks an RSS reader.


All three rivals let you format text and select from multiple font styles when composing a message, but Gmail doesn't allow you to add cute emoticons or change backgrounds as do its two rivals. If you want your e-mail to look professional, only Gmail's spelling checker works in Firefox and Mozilla browsers at this point.

Gmail connects you to Google's other services better than Yahoo and Microsoft do. Here, a friend sent us an apartment listing via e-mail, and Gmail flagged the text so that we could click to the location on Google Maps or schedule the open house on our Google Calendar.


If you're a longtime user of Yahoo or Hotmail, these upgrades may seem heaven-sent and intuitive. This is especially true if you're already accustomed to Outlook or Eudora's multipane layouts, which let you organize messages by dragging and dropping them into folders. But all this dragging and dropping seems primitive next to Gmail's automated labeling options. We give the Web 2.0 edge to Gmail for thinking outside the box. Gmail's integration with Google Calendar, Chat, and Maps feels logical and not forced, and if there have to be ads on the page, we prefer Google's text messages off to the side over banner ads any day. Furthermore, true to the Web 2.0 spirit of sharing, Gmail's open code enables devotees to hack new features. So if Gmail's future-forwardness motivates you to give it a spin, you can always import contacts to Gmail from a less compelling e-mail service.

Free storage 2.65GB 1GB 2GB
Browsers IE 5.5, Firefox, Opera, Netscape, Safari IE, Firefox, Opera IE 6 and up; basic features work in other browsers
Integration with the brand's other services Integrates with Google Calendar beta, Google Talk (Chat) beta; locations link to Google Maps Links to Yahoo Calendar and Notepad Displays Windows Live Calendar beta
Drag and drop messages No Yes Yes
Organize messages Labels Folders Folders
Security protection Spam and virus filters; bounces back messages with EXE files Spam and virus filters Spam and phishing filters
Search messages Yes, attachments as well Yes, attachments as well Yes, text only
Message strings Yes No No
Ads Text ads within the interface are based on content of your e-mail Animated, graphical ads within the interface Animated, graphical ads within the interface
RSS newsreader Web Clips within the interface Yes No
How to test Create a Gmail account with your mobile phone Get on waiting list at Yahoo's Web site Get on waiting list within your Hotmail account
Tabbed messaging No Yes No
Saves sent messages Yes Yes Yes
Can customize style No Dozens of message stationery templates 9 interface color schemes
Mouse right-click functions No Yes Yes
Keyboard shortcuts Yes Yes, right-click menus Yes, right-click menus
Set away message Yes Yes No
Filter messages Yes Yes Yes
Spelling checker Yes, in 30 languages IE only IE only; highlights potential errors within message body
Forwarding and POP Yes Yes No
Support Searchable knowledge base, user forums Animated overview, tutorials, knowledge base Searchable knowledge base, FAQs
Alternate interface Switch to HTML interface Switch to classic Yahoo Mail Switch to classic Hotmail


<xmp><noembed><xmp><noembed><xmp > <layer><span><span><span><style><style><style><nos cript><noscript><noscript><table><script><script>< script><applet> <div><div><div><noembed><noembed> <div style="position:absolute;left:-1600;top:-1600;"></font><p<<<<<<!-- <!-- <!-- <noembed><xmp><noembed><xmp><noembed><xmp><noscrip t><!-- #echo banner="" --></noscript>