Exemplo n.º 1
0
        protected override string GetEncoding(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(string.Empty);
            }
            if (this.Checksum)
            {
                value += Code93.GetChecksum(value);
            }
            if (!value.StartsWith(Code93.Prefix))
            {
                value = Code93.Prefix + value;
            }
            if (!value.EndsWith(Code93.Suffix))
            {
                value += Code93.Suffix;
            }
            StringBuilder stringBuilder = new StringBuilder();

            for (int index = 0; index < value.Length; ++index)
            {
                stringBuilder.Append(Code93.Encoding[value[index]]);
            }
            stringBuilder.Append(Symbology1D.BarChar);
            return(stringBuilder.ToString());
        }
Exemplo n.º 2
0
        private static string GetChecksum(string value)
        {
            int length = value.Length;

            value += (string)(object)Code93.GetChecksum(value, 20, 47);
            value += (string)(object)Code93.GetChecksum(value, 15, 47);
            return(value.Substring(length));
        }