GS1 check digit SSCC calculation

Software technical issues not related to any of the other categories

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Luca
Newcomer
Posts: 1
Joined: Wed Nov 11, 2020 9:28 am

GS1 check digit SSCC calculation

Post by Luca » Wed Nov 11, 2020 9:43 am

Hi,
we're using NL to automate the labeling process on production lines.
We wrote a program using Automation Builder with a trigger on a SQL table.

This program calculate the SSCC (17 chars). This SSCC is printed out on the label and the check digit is automatically generated (we activated the option Auto-generate Check Digit on GS1-128 dialog).

I need to save the SSCC (including Check digit) on a SQL table.
I do that using a SQL command in Automation to insert the information in the table.
The problem is that if I use Modulo10(SSCC,1) function I receive a different Check digit from the one printed on the label.
I tested all the check digit functions but I didn't find the right one.

So my questions are: is there some other function that calculate the same check digit printed on the label? If not can I wrote a function in Automation (I didn't find a place where I can wrote my function)?
Regards
Luca

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 720
Joined: Mon Aug 28, 2017 3:07 pm

Re: GS1 check digit SSCC calculation

Post by Kyleodonnell » Wed Nov 11, 2020 4:06 pm

Luca,

We recommend opening a support case https://www.nicelabel.com/support/techn ... gn=Support

tor.jorgen
Newcomer
Posts: 1
Joined: Thu Jan 14, 2021 6:24 pm

Re: GS1 check digit SSCC calculation

Post by tor.jorgen » Thu Jan 14, 2021 6:30 pm

I have the same issue with modulo10 calculating the wrong check digit for sscc, have you been able to solve this?

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 720
Joined: Mon Aug 28, 2017 3:07 pm

Re: GS1 check digit SSCC calculation

Post by Kyleodonnell » Fri Jan 15, 2021 2:38 pm


User avatar
Saso
NiceLabel
NiceLabel
Posts: 2988
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: GS1 check digit SSCC calculation

Post by Saso » Tue Feb 09, 2021 11:57 am

You can use this Python script to calculate the SSCC check digit.

You can use the function to calculate any "GS1 Modulo10"-based check digit (e.g. SSCC, EAN-13, UPC-A, etc.)

Code: Select all

def GS1CheckDigit(num, append):
    value = str(num)

    if not value.isdigit():
        return "Value should contain only numbers."

    w = [3, 1]
    j = 0
    sum = 0
    inverseValue = value[::-1]

    for i in xrange(len(value)):
        a = int(inverseValue[i])
        b = int(a)*w[j]
        sum += b
        j = j + 1
        j = 0 if j == 2 else j

    sum = 10 - (sum % 10)
    sum = 0 if sum == 10 else sum

    return str(sum) if append == 0 else value + str(sum)

Code: Select all

# Sample Usage
Result.Value = GS1CheckDigit("12345678901234567",1)
Saso Fleiser
Senior Technical Product Specialist

Post Reply