Example #1
0
        public static int CalculateChecksum(string value)
        {
            var numbers = new GtinNumbers(value);
            var sum     = 3 * numbers.N1 +
                          numbers.N2 +
                          3 * numbers.N3 +
                          numbers.N4 +
                          3 * numbers.N5 +
                          numbers.N6 +
                          3 * numbers.N7 +
                          numbers.N8 +
                          3 * numbers.N9 +
                          numbers.N10 +
                          3 * numbers.N11 +
                          numbers.N12 +
                          3 * numbers.N13 +
                          numbers.N14 +
                          3 * numbers.N15 +
                          numbers.N16 +
                          3 * numbers.N17;
            var checksum = sum.UpToNearestTen() - sum;

            return(checksum);
        }
Example #2
0
 public Gtin(string value) : base(value)
 {
     Numbers = new GtinNumbers(value);
 }