DotNet Home | VB.Net | Category | Special | GuestBook | Contribute | Search
Current: DotNet Home >> VB.Net >> How to Generate Check Digits and verify your barcodes

How to Generate Check Digits and verify your barcodes

2007-12-14 14:14:56  Author: Polymorpher  Source: codeproject.com  Click: 10  Text Size: [A] [A] [A]
Intro: Introduction This only does 12 digit barcodes for now. if your interested in how this works go towww.howstuffworks.com/upc.htm whichi is where I got most of my information. I just though ...

Sample Image - BarcodeCheckDigAndVerify.png

Introduction

This only does 12 digit barcodes for now. if your interested in how this works go to
www.howstuffworks.com/upc.htm whichi is where I got most of my information. I just thought it would be nice to have a quick function to do the math for me and figured I should share ;)

a basic summary goes something like this:

To figure out what the chekdigit is suposed to be add together all of the odd digits and multiply by 3, then add all the even digits and add to the last result. Then find the number that when added to that makes it evenly divisible by to (10-(total mod 10))

To make sure a barcode is valid just do the same math but at the end say (total mod 10)==0

Its fairly basic but seems a little backwards on a string since they are zero based arrays. You just swap evens for odds

Admin: licici_1


 
 
 
Google Link
New Articles
More >
· Working with the Web Brows...
· How to solve "Cross thread...
· Implementation of LZW Comp...
· Advanced text searching
· A Fast Diff Algorithm in V...
· Read MP3 header informatio...
· Images\' Steganography
· How to Generate Check Digi...
· How to Load and Display Cr...
· Read Barcodes from an Imag...