Esempio n. 1
0
        protected override string GetEncoding(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(string.Empty);
            }
            int[]      indices = this.GetIndices(value);
            List <int> intList = new List <int>((IEnumerable <int>)indices);

            if (this.Checksum)
            {
                intList.Add(Code128.GetChecksum(indices));
            }
            intList.Add(Code128.suffix);
            StringBuilder stringBuilder = new StringBuilder();

            foreach (int index in intList)
            {
                stringBuilder.Append(Code128.encoding[index]);
            }
            stringBuilder.Append(Symbology1D.BarChar);
            stringBuilder.Append(Symbology1D.BarChar);
            return(stringBuilder.ToString());
        }
Esempio n. 2
0
 private static int GetChecksum(int[] array)
 {
     return(Code128.GetChecksum(array, 103));
 }