예제 #1
0
        protected override string GetEncoding(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(string.Empty);
            }
            char          checksum      = UPCSupplement5.GetChecksum(value);
            string        str           = UPCSupplement5.Parity[checksum];
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(UPCSupplement5.Encoding[string.Empty]);
            for (int index1 = 0; index1 < value.Length; ++index1)
            {
                if (stringBuilder.Length > 0)
                {
                    stringBuilder.Append(Symbology1D.GapChar);
                    stringBuilder.Append(Symbology1D.BarChar);
                }
                string index2 = str[index1].ToString() + value[index1].ToString();
                stringBuilder.Append(UPCSupplement5.Encoding[index2]);
            }
            return(stringBuilder.ToString());
        }
예제 #2
0
 private static char GetChecksum(string value)
 {
     return(UPCSupplement5.GetChecksum(value, 3, 9, 10));
 }