Delphi classes to calculate the GS1 barcode check digit

This article is for Delphi developers who have to generate GS1 barcodes like an SSCC or an EAN type.

Sergio Govoni
Oct 31, 2020

The GS1 EAN standard coding requires that every well-formed code ends with a check-digit that will be used by barcode readers to interpret the code properly. The check-digit is a number between zero and nine and it is calculated according to the other digits in the code. The calculation algorithm is shown here.

In my previous article I described how to implement the algorithm to calculate the check digit of a GS1 barcode in T-SQL language for SQL Server. After publishing the T-SQL code on my GitHub repository I decided to develop the same solution also for Delphi. The project is simple but it could be useful if you are a Delphi developer who have to generate GS1 barcodes like a serial shipping container code (SSCC) or an EAN barcode. In these cases, you have to calculate the last digit (also known as check digit) for your barcodes, in a way that is simple, safe and quick!

The Delphi solution consists in a series of classes, one for each type of GS1 barcode we support, and a class that is able to manage the requests of check digit calculation.

Classes are contained in the run time package GS1CheckDigitCalculatorRT.bpl and a simple GUI is implemented in the project GS1CheckDigitCalculator.exe.

You can find the source code here! I hope it is useful!

Enjoy!

--

--

Sergio Govoni
Sergio Govoni

Written by Sergio Govoni

CTO at Centro Software, Microsoft Data Platform MVP

No responses yet