Skip to content

Commit

Permalink
Merge pull request #116 from barnhill/fix-s2of5
Browse files Browse the repository at this point in the history
Fix s2of5
  • Loading branch information
barnhill authored Jan 17, 2021
2 parents 9c8bb52 + f2e47c9 commit 4014ce5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions BarcodeStandard/BarcodeCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public List<string> Errors
get { return this._Errors; }
}

public void Error(string ErrorMessage)
public void Error(string errorMessage)
{
this._Errors.Add(ErrorMessage);
throw new Exception(ErrorMessage);
this._Errors.Add(errorMessage);
throw new Exception(errorMessage);
}

internal static bool CheckNumericOnly(string Data)
internal static bool CheckNumericOnly(string data)
{
return Regex.IsMatch(Data, @"^\d+$", RegexOptions.Compiled);
return Regex.IsMatch(data, @"^\d+$", RegexOptions.Compiled);
}
}//BarcodeVariables abstract class
}//namespace
6 changes: 4 additions & 2 deletions BarcodeStandard/BarcodeStandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.2.8</Version>
<Version>2.2.10</Version>
<PackageId>BarcodeLib</PackageId>
<Company>Pnuema Productions</Company>
<Product>BarcodeLib</Product>
<Authors>Brad Barnhill</Authors>
<Description>This library was designed to give an easy class for developers to use when they need to generate barcode images from a string of data.</Description>
<Copyright>Copyright 2007-2020 Brad Barnhill</Copyright>
<Copyright>Copyright 2007-2021 Brad Barnhill</Copyright>
<PackageProjectUrl>https://github.com/barnhill/barcodelib</PackageProjectUrl>
<RepositoryUrl>https://github.com/barnhill/barcodelib.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -19,6 +19,8 @@
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIcon>upca.jpg</PackageIcon>
<PackageIconUrl />
<AssemblyVersion>2.2.10.0</AssemblyVersion>
<FileVersion>2.2.10.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions BarcodeStandard/Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release Notes for BarcodeLib.dll
================================
2.2.10.0
- Fix Standard 2 of 5 encoding bug
2.2.9.0
- Fix Interleaved 2 of 5 encoding bug
2.2.8.0
- Fix Standard 2 of 5 checksum calculation
2.2.7.0
Expand Down
6 changes: 3 additions & 3 deletions BarcodeStandard/Symbologies/Standard2of5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ private string Encode_Standard2of5()

var result = "11011010";

foreach (var c in Raw_Data)
for (int i = 0; i < Raw_Data.Length; i++)
{
result += S25_Code[Int32.Parse(c.ToString())];
}//foreach
result += S25_Code[(int)char.GetNumericValue(Raw_Data, i)];
}

result += _encodedType == TYPE.Standard2of5_Mod10 ? S25_Code[CalculateMod10CheckDigit()] : "";

Expand Down

0 comments on commit 4014ce5

Please sign in to comment.