Skip to content

Commit bf46864

Browse files
committed
Luhn.NET: Bump version to [v1.1.0]
Resolves: No entry
1 parent c724d0c commit bf46864

File tree

4 files changed

+68
-17
lines changed

4 files changed

+68
-17
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [1.1.0] - 2024-03-30
88
### Added
99
- Add `ConvertAlphaNumericToNumeric` method to convert a string containing alphanumeric characters to a string containing only numeric characters (use case: converting an ISIN to a numeric string for Luhn validation).
1010

11-
## [1.0.1] - 2024-02-19
11+
## [1.0.1] - 2024-03-19
1212
### Fixed
1313
- Fixed a bug in `Luhn.ComputeLuhnNumber` and `Luhn.ComputeLuhnCheckDigit` methods that sometimes returned an incorrect result.
1414

@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646
### Added
4747
- Added initial version of LuhnDotNet
4848

49+
[1.1.0]: https://github.com/shinji-san/LuhnDotNet/compare/v1.0.1..v1.1.0
4950
[1.0.1]: https://github.com/shinji-san/LuhnDotNet/compare/v1.0.0..v1.0.1
5051
[1.0.0]: https://github.com/shinji-san/LuhnDotNet/compare/v0.2.0..v1.0.0
5152
[0.2.0]: https://github.com/shinji-san/LuhnDotNet/compare/v0.1.0..v0.2.0

README.md

+61-11
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ The Luhn algorithm is a checksum formula used to validate identification numbers
6363
</thead>
6464
<tbody>
6565
<tr>
66-
<td rowspan=10><a href="https://github.com/shinji-san/LuhnDotNet/actions?query=workflow%3A%22LuhnDotNet+NuGet%22" target="_blank"><img src="https://github.com/shinji-san/LuhnDotNet/workflows/LuhnDotNet%20NuGet/badge.svg?branch=v1.0.1" alt="LuhnDotNet NuGet"/></a></td>
67-
<td rowspan=10><a href="https://badge.fury.io/nu/LuhnDotNet" target="_blank"><img src="https://badge.fury.io/nu/LuhnDotNet.svg" alt="NuGet Version 1.0.1"/></a></td>
68-
<td rowspan=10><a href="https://github.com/shinji-san/LuhnDotNet/tree/v1.0.1" target="_blank"><img src="https://img.shields.io/badge/LuhnDotNet-1.0.1-green.svg?logo=github&logoColor=959da5&color=2ebb4e&labelColor=2b3137" alt="Tag"/></a></td>
66+
<td rowspan=10><a href="https://github.com/shinji-san/LuhnDotNet/actions?query=workflow%3A%22LuhnDotNet+NuGet%22" target="_blank"><img src="https://github.com/shinji-san/LuhnDotNet/workflows/LuhnDotNet%20NuGet/badge.svg?branch=v1.1.0" alt="LuhnDotNet NuGet"/></a></td>
67+
<td rowspan=10><a href="https://badge.fury.io/nu/LuhnDotNet" target="_blank"><img src="https://badge.fury.io/nu/LuhnDotNet.svg" alt="NuGet Version 1.1.0"/></a></td>
68+
<td rowspan=10><a href="https://github.com/shinji-san/LuhnDotNet/tree/v1.1.0" target="_blank"><img src="https://img.shields.io/badge/LuhnDotNet-1.1.0-green.svg?logo=github&logoColor=959da5&color=2ebb4e&labelColor=2b3137" alt="Tag"/></a></td>
6969
<td>.NET 6</td>
7070
</tr>
7171
<tr>
@@ -102,10 +102,10 @@ The Luhn algorithm is a checksum formula used to validate identification numbers
102102

103103
1. Open a console and switch to the directory, containing your project file.
104104

105-
2. Use the following command to install version 1.0.1 of the LuhnDotNet package:
105+
2. Use the following command to install version 1.1.0 of the LuhnDotNet package:
106106

107107
```dotnetcli
108-
dotnet add package LuhnDotNet -v 1.0.1 -f <FRAMEWORK>
108+
dotnet add package LuhnDotNet -v 1.1.0 -f <FRAMEWORK>
109109
```
110110
111111
3. After the completion of the command, look at the project file to make sure that the package is successfully installed.
@@ -114,7 +114,7 @@ The Luhn algorithm is a checksum formula used to validate identification numbers
114114
115115
```xml
116116
<ItemGroup>
117-
<PackageReference Include="LuhnDotNet" Version="1.0.1" />
117+
<PackageReference Include="LuhnDotNet" Version="1.1.0" />
118118
</ItemGroup>
119119
```
120120
## Remove LuhnDotNet package
@@ -263,6 +263,50 @@ namespace Example6
263263
}
264264
```
265265

266+
## Compute credit card number with LuhnDotNet
267+
The `LuhnDotNet` library can be used to compute the check digit of a credit card number. The check digit is the last digit of the credit card number, which is used to validate the number according to the Luhn algorithm.
268+
269+
```csharp
270+
using System;
271+
using LuhnDotNet;
272+
273+
namespace Example7
274+
{
275+
public class Program
276+
{
277+
public static void Main(string[] args)
278+
{
279+
string creditCardNumberWithoutCheckDigit = "4417 1234 5678 911".Replace(" ", "");
280+
byte checkDigit = Luhn.ComputeLuhnCheckDigit(creditCardNumberWithoutCheckDigit);
281+
282+
Console.WriteLine($"The check digit for credit card number {creditCardNumberWithoutCheckDigit} is: {checkDigit}");
283+
}
284+
}
285+
}
286+
```
287+
288+
## Validate credit card number with LuhnDotNet
289+
The `LuhnDotNet` library can be used to validate a credit card number according to the Luhn algorithm. The `IsValid` method returns `true` if the credit card number is valid, and `false` otherwise.
290+
291+
```csharp
292+
using System;
293+
using LuhnDotNet;
294+
295+
namespace Example8
296+
{
297+
public class Program
298+
{
299+
public static void Main(string[] args)
300+
{
301+
string creditCardNumber = "4417 1234 5678 9113".Replace(" ", "");
302+
bool isValid = Luhn.IsValid(creditCardNumber);
303+
304+
Console.WriteLine($"The credit card number {creditCardNumber} is valid: {isValid}");
305+
}
306+
}
307+
}
308+
```
309+
266310
# CLI building instructions
267311
For the following instructions, please make sure that you are connected to the internet. If necessary, NuGet will try to restore the [xUnit](https://xunit.net/) packages.
268312
## Using dotnet to build for .NET 6, .NET 7, .NET 8 and .NET FX 4.x
@@ -272,30 +316,36 @@ Use one of the following solutions with `dotnet` to build [LuhnDotNet](#luhndotn
272316

273317
The syntax is:
274318
```dotnetcli
275-
dotnet {build|test} -c {Debug|Release} LuhnDotNet.sln
319+
dotnet {restore|build|test} -c {Debug|Release} LuhnDotNet.sln
320+
```
321+
322+
### Restore NuGet packages
323+
324+
```dotnetcli
325+
dotnet restore LuhnDotNet.sln
276326
```
277327

278328
The instructions below are examples, which operate on the `LuhnDotNet.sln`.
279329
### Build Debug configuration
280330

281331
```dotnetcli
282-
dotnet build -c Debug LuhnDotNet.sln
332+
dotnet build -c Debug --no-restore LuhnDotNet.sln
283333
```
284334

285335
### Build Release configuration
286336

287337
```dotnetcli
288-
dotnet build -c Release LuhnDotNet.sln
338+
dotnet build -c Release --no-restore LuhnDotNet.sln
289339
```
290340

291341
### Test Debug configuration
292342

293343
```dotnetcli
294-
dotnet test -c Debug LuhnDotNet.sln
344+
dotnet test -c Debug --no-restore --no-build LuhnDotNet.sln
295345
```
296346

297347
### Test Release configuration
298348

299349
```dotnetcli
300-
dotnet test -c Release LuhnDotNet.sln
350+
dotnet test -c Release --no-restore --no-build LuhnDotNet.sln
301351
```

src/LuhnDotNet.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
<Authors>Sebastian Walther</Authors>
1212
<PackageId>LuhnDotNet</PackageId>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14-
<PackageReleaseNotes>Changelog: https://github.com/shinji-san/LuhnDotNet/blob/v1.0.1/CHANGELOG.md</PackageReleaseNotes>
14+
<PackageReleaseNotes>Changelog: https://github.com/shinji-san/LuhnDotNet/blob/v1.1.0/CHANGELOG.md</PackageReleaseNotes>
1515
<PackageDescription>An C# implementation of the Luhn algorithm</PackageDescription>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
1717
<PackageTags>luhn;luhn-algorithm</PackageTags>
1818
<PackageProjectUrl>https://github.com/shinji-san/LuhnDotNet</PackageProjectUrl>
1919
<RepositoryUrl>https://github.com/shinji-san/LuhnDotNet</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
21-
<Version>1.0.1</Version>
21+
<Version>1.1.0</Version>
2222
<Authors>Sebastian Walther</Authors>
2323
<Company>Private Person</Company>
2424
<GenerateDocumentationFile>true</GenerateDocumentationFile>

src/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
[assembly: Guid("bba40d96-b58d-4a8f-b6fc-3699e0addf98")]
1717

18-
[assembly: AssemblyVersion("1.0.1")]
19-
[assembly: AssemblyFileVersion("1.0.1")]
18+
[assembly: AssemblyVersion("1.1.0")]
19+
[assembly: AssemblyFileVersion("1.1.0")]
2020
[assembly: NeutralResourcesLanguage("en")]
2121

2222
[assembly: System.CLSCompliant(true)]

0 commit comments

Comments
 (0)