Académique Documents
Professionnel Documents
Culture Documents
This document 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.
MASTERCARD
Prefix
51-55
Length
16
Check digit
algorithm
mod 10
VISA
13, 16
mod 10
AMEX
34
37
15
mod 10
Diners Club/
Carte Blanche
300-305
36
38
14
mod 10
Discover
6011
16
mod 10
enRoute
2014
2149
15
any
JCB
16
mod 10
JCB
2131
1800
15
mod 10
CARD TYPE
<Index>19</Index>
<RGB>#A0E0E0</RGB>
</Color>
<Color>
<Index>20</Index>
<RGB>#600080</RGB>
</Color>
<Color>
<Index>22</Index>
<RGB>#0080C0</RGB>
</Color>
<Color>
<Index>23</Index>
<RGB>#C0C0FF</RGB>
</Color>
<Color>
<Index>33</Index>
<RGB>#69FFFF</RGB>
</Color>
<Color>
<Index>36</Index>
<RGB>#A6CAF0</RGB>
</Color>
<Color>
<Index>37</Index>
<RGB>#CC9CCC</RGB>
</Color>
<Color>
<Index>39</Index>
<RGB>#E3E3E3</RGB>
</Color>
<Color>
<Index>42</Index>
<RGB>#339933</RGB>
</Color>
<Color>
<Index>43</Index>
<RGB>#999933</RGB>
</Color>
<Color>
<Index>44</Index>
<RGB>#996633</RGB>
</Color>
<Color>
<Index>45</Index>
<RGB>#996666</RGB>
</Color>
<Color>
<Index>48</Index>
<RGB>#3333CC</RGB>
</Color>
<Color>
<Index>49</Index>
<RGB>#336666</RGB>
</Color>
<Color>
<Index>52</Index>
<RGB>#663300</RGB>
</Color>
<Color>
<Index>55</Index>
<RGB>#424242</RGB>
</Color>
</Colors>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>6690</WindowHeight>
<WindowWidth>11235</WindowWidth>
<WindowTopX>360</WindowTopX>
<WindowTopY>105</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font ss:FontName="Arial"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
ss:WrapText="1"/>
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="14" ss:Italic="1"/>
<Protection/>
</Style>
<Style ss:ID="s34">
<Alignment ss:Horizontal="CenterAcrossSelection" ss:Vertical="Bottom"
ss:WrapText="1"/>
<Protection/>
</Style>
<Style ss:ID="s35">
<Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
<Protection/>
</Style>
<Style ss:ID="s36">
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
<Protection/>
</Style>
<Style ss:ID="s37">
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
<Font ss:FontName="Arial" ss:Bold="1"/>
<Protection/>
</Style>
<Style ss:ID="s38">
<Alignment ss:Horizontal="Center" ss:Vertical="Top"/>
<Borders>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
</Borders>
<Protection/>
</Style>
</Styles>
</Row>
<Row>
<Cell ss:Index="6" ss:StyleID="s28"><Data ss:Type="String">Enter Credit Card # Here:</Data></Cell>
<Cell><Data ss:Type="String">Text Evaluation of same:</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s24"/>
<Cell ss:StyleID="s29"/>
<Cell ss:StyleID="s27"/>
<Cell ss:Index="6" ss:StyleID="s21"><Data ss:Type="Number">541234567890125</Data></Cell>
<Cell ss:StyleID="s30" ss:Formula="=TEXT(RC[-1],"00000000000000000000")"><Data
ss:Type="String">00000541234567890125</Data></Cell>
</Row>
<Row ss:Height="27" ss:StyleID="s35">
<Cell ss:StyleID="s31"><Data ss:Type="String">Digit Number</Data></Cell>
<Cell ss:StyleID="s32"><Data ss:Type="String">Card Value</Data></Cell>
<Cell ss:StyleID="s31"><Data ss:Type="String">Multiplied By</Data></Cell>
<Cell ss:StyleID="s31"><Data ss:Type="String">Equals</Data></Cell>
<Cell ss:StyleID="s31"><Data ss:Type="String">Sum of the digits</Data></Cell>
<Cell ss:StyleID="s33"
ss:Formula="=IF(MOD(R[21]C[-1],10)=0,"This number passes!","This number does not
pass!")"><Data
ss:Type="String">This number passes!</Data></Cell>
<Cell ss:StyleID="s34"/>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">5</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">5</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">5</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">2</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">4</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">4</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">3</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">1</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">1</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">4</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">5</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">9</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">9</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">9</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">6</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">8</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">16</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">7</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">7</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">7</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">7</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">7</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">8</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">6</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">12</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">3</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">9</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">5</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">5</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">5</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">10</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">4</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">8</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">8</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">11</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">3</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">3</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">3</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">12</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">2</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">4</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">4</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">13</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">1</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">1</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">14</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">4</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">8</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">8</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">15</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">5</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">5</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">5</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">16</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">17</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">18</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"><Data ss:Type="Number">19</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row ss:Height="13.5">
<Cell ss:StyleID="s36"><Data ss:Type="Number">20</Data></Cell>
<Cell ss:StyleID="s37" ss:Formula="=MID(R5C7,21-RC[-1],1)"><Data
ss:Type="String">0</Data></Cell>
<Cell ss:StyleID="s36"><Data ss:Type="Number">2</Data></Cell>
<Cell ss:StyleID="s36" ss:Formula="=RC[-2]*RC[-1]"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s36"
ss:Formula="=IF(RC[-1]<10,RC[-1],INT(RC[-1]/10)+MOD(RC[-1],10))"><Data
ss:Type="Number">0</Data></Cell>
</Row>
<Row>
<Cell ss:StyleID="s36"/>
<Cell ss:StyleID="s37"/>
<Cell ss:StyleID="s36"/>
<Cell ss:StyleID="s36"/>
<Cell ss:StyleID="s38" ss:Formula="=SUM(R[-20]C:R[-1]C)"><Data ss:Type="Number">70</Data></Cell>
<Cell><Data ss:Type="String">Grand Total (Checksum)</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Header x:Data="&A"/>
<Footer x:Data="Page &P"/>
</PageSetup>
<Print>
<ValidPrinterInfo/>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveCol>4</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>True</ProtectObjects>
<ProtectScenarios>True</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>