Quick Search for:  in language:    
Checks,Credit,Card,Number,valid,performing,LU
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,014,970. lines
 Jobs: 119. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic
Click here to see a screenshot of this code!Xp Frames , Xp List Box And XpTextBox (updated!)
By ali s on 7/2

(Screen Shot)

Click here to see a screenshot of this code!Excel Into a webpage
By Bill Donahue on 7/2

(Screen Shot)

Unroll2 - Update
By Cyber Chris on 7/2


MultilinePWD
By Cyber Chris on 7/2


Click here to see a screenshot of this code!Song/Poem Assistant
By Peter Rowan on 7/2

(Screen Shot)

Click here to see a screenshot of this code!GPA Cal
By KBM-00 on 7/2

(Screen Shot)

Click here to see a screenshot of this code!Connection Via the Telephone line.No internet or cable.Just the telephone line
By Nass ClickMan on 7/2

(Screen Shot)

DBTool
By Make Strömberg on 7/2


Click here to see a screenshot of this code!MSChart Simple Example
By Sebastian Pereira on 7/2

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Credit Card Checksum Checker

Print
Email
 

Submitted on: 5/27/1998
By: John Anderson  
Level: Not Given
User Rating: By 106 Users
Compatibility:VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 18602 times.
 
 
     Checks to see if a Credit Card Number is valid by performing the LUHN-10 check on it.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Credit Card Checksum Checker
' Description:Checks to see if a Credit 
'     Card Number is valid by performing the L
'     UHN-10 check on it.
' By: John Anderson
'
' Inputs:CCNum as String
'
' Returns:True if Valid, False if Invali
'     d
'
' Side Effects:May cause skin irritation
'     
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=902&lngWId;=1'for details.'**************************************

Public Function IsValidCCNum(CCNum As String) As Boolean

Dim i As Integer Dim total As Integer Dim TempMultiplier As String For i = Len(CCNum) To 2 Step -2 total = total + CInt(Mid$(CCNum, i, 1)) TempMultiplier = CStr((Mid$(CCNum, i - 1, 1)) * 2) total = total + CInt(Left$(TempMultiplier, 1)) If Len(TempMultiplier) > 1 Then total = total + CInt(Right$(TempMultiplier, 1)) Next
If Len(CCNum) Mod 2 = 1 Then total = total + CInt(Left$(CCNum, 1)) If total Mod 10 = 0 Then IsValidCCNum = True Else IsValidCCNum = False End If
End Function


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/29/1999 8:26:00 AM:fengbald
Nice routine will use it at work.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/19/1999 3:08:00 PM:odeadendo
good idea
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/19/1999 11:00:00 AM:blah
How do we use this?? I mean... how do I 
tell it what the CCNum is.. and when to 
check it?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/5/1999 9:48:00 AM:slackker
John would it be possible to know what 
the interface should be like or have on 
it to use this code? Thanks slackker
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/22/1999 10:05:00 AM:Faisal
Thanx for the code. I was just 
wondering, won't it be dangerous to use 
this code to create valid credit card 
numbers? If so then you should prevent 
it somehow. Thanx again.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/19/1999 9:55:00 AM:Kevin
Can you just paste this into a web page 
as VBScript?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/27/1999 1:19:00 PM:JP
wow... didn't knew CCChecksum was that 
easy ;)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/1999 3:26:00 PM:dynasty
any cc generater could outsmart this 
program.....no good... -=)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/26/1999 8:21:00 PM:UM
not nessisarily
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/28/1999 8:38:55 PM:John Anderson
blah - CCNum should be a string 
containing the Credit Card number 
without spaces/dashes/etc.  The routine 
returns True if Valid, False if 
not.
slackker - This was developed 
for use in an e-commerce solution.  The 
best way to use this is to do a quick 
check for typos before submitting the 
card number to your 
processor.
Faisal - This checksum 
method is widely known.  The only 100% 
secure way to verify a valid card 
number is through a credit card 
processor (i.e. Cybercash)
dynasty - 
You're right.  But the odds of your CC 
Generator picking the number of a valid 
card are less than the odds of you 
winning the lottery. =)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.