Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Calculate checksum for Ean13 barcode number

Avatar of Peter Nordberg
Peter NordbergFlag for Sweden asked on
.NET ProgrammingASP.NETVisual Basic.NET
13 Comments1 Solution2569 ViewsLast Modified:
Hi experts,

I would like to calculate the checksum of a Ean13 barcode in my webapplication. I'm not sure how to accomplish this in code, but I have the instructions to do so:

Exempel: EAN13

7 3 0 0 0 1 1 0 0 0 0 1K

1.Sum every second number from right:. 1+0+0+1+0+3=5
2. Multiply the sum with the number 3.    5 X 3 = 15
3.Sum every second of the remaining numbers. 0+0+1+0+0+7=8
4.Add the result to the already calculated sum. 15+8=23
5.The totalsum is subtracted from the nearest ten, in this case 30. Checksum is 30-23=7 and Ean-13:

7 3 0 0 0 1 1 0 0 0 0 1  7

If anyone have a suggestion on how to accomplish this in code (preferably vb.net), it would be great.

Thanks for your help!

Peter