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

            for (int index = 0; index < value.Length; ++index)
            {
                if (stringBuilder.Length > 0)
                {
                    stringBuilder.Append(Symbology1D.GapChar);
                }
                stringBuilder.Append(Code39.Encoding[value[index]]);
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 2
0
 private static char GetChecksum(string value)
 {
     return(Code39.GetChecksum(value, 43));
 }