protected override string ParseText(string value, CodedValueCollection codes) { value = base.ParseText(value, codes); value = Regex.Replace(value, "[-\\s]", ""); byte[] data1 = IntelligentMailHelper.Instance.ConvertToBytes(IntelligentMailHelper.Instance.ConvertRoutingCode(value.Substring(20)), value.Substring(0,20)); int fcs = IntelligentMailHelper.Instance.CRC11(data1); short[] data2 = IntelligentMailHelper.Instance.ConvertToCodewords(data1); if (IntelligentMailHelper.Instance.CheckFcs(fcs)) data2[0] += 659; IntelligentMailHelper.Instance.ConvertToCharacters(data2); IntelligentMailHelper.Instance.IncludeFcs(data2, fcs); codes.AddRange(IntelligentMailHelper.Instance.ConvertToBars(data2)); return null; }
protected override string ParseText(string value, CodedValueCollection codes) { value = base.ParseText(value, codes); value = Regex.Replace(value, "[-\\s]", ""); byte[] data1 = IntelligentMailHelper.Instance.ConvertToBytes(IntelligentMailHelper.Instance.ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20)); int fcs = IntelligentMailHelper.Instance.CRC11(data1); short[] data2 = IntelligentMailHelper.Instance.ConvertToCodewords(data1); if (IntelligentMailHelper.Instance.CheckFcs(fcs)) { data2[0] += 659; } IntelligentMailHelper.Instance.ConvertToCharacters(data2); IntelligentMailHelper.Instance.IncludeFcs(data2, fcs); codes.AddRange(IntelligentMailHelper.Instance.ConvertToBars(data2)); return(null); }
public override CodedValueCollection GetCodes(string value) { var codes = new CodedValueCollection(); value = Regex.Replace(value, "[-\\s]", ""); byte[] data1 = ConvertToBytes(ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20)); int fcs = CRC11(data1); short[] data2 = ConvertToCodewords(data1); if (CheckFcs(fcs)) { data2[0] += 659; } ConvertToCharacters(data2); IncludeFcs(data2, fcs); codes.AddRange(ConvertToBars(data2)); return(codes); }
public override CodedValueCollection GetCodes(string value) { var codes = new CodedValueCollection(); value = Regex.Replace(value, "[-\\s]", ""); byte[] data1 = ConvertToBytes(ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20)); int fcs = CRC11(data1); short[] data2 = ConvertToCodewords(data1); if (CheckFcs(fcs)) data2[0] += 659; ConvertToCharacters(data2); IncludeFcs(data2, fcs); codes.AddRange(ConvertToBars(data2)); return codes; }