A human-friendly generator for license keys and serial numbers.
- Full multithreading, thanks to .NET Core’s TPL (Task Parallel Library);
- Custom “resulting-sum” algorithm to generate a bunch of unique license keys quickly;
- Responsive UI, built in WinForms (glamorous, indeed);
- On-the-fly license key validator;
- Decoupling, e.g. strict separation between UI and logic;
- Generated license keys that are easy for people to spell out loud;
- Native support for async/await.
NuGet packages, demo, source
Get the generator NuGet package from https://www.nuget.org/packages/BarbezDotEu.License.Generation/ or use
Install-Package BarbezDotEu.License.Generation -Version 1.0.0
Get the verifier NuGet package from https://www.nuget.org/packages/BarbezDotEu.License.Verification/ or use
Install-Package BarbezDotEu.License.Verification -Version 1.0.0
Source code on GitHub: hannesbarbez/BarbezDotEu.License: License key generation and verification (github.com)
Demo application for inspiration: hannesbarbez/BarbezDotEu.License.Generator.WinForms: Barbez.Eu Serial Number Generator (github.com)
Custom “resulting-sum” algorithm
Lacking academic knowledge on serial number or license key generation algos, the generator algorithm is my own idea, so I’ve decided to dub it “resulting-sum”. More info on the exact workings to follow, for now the source code should suffice to explain its inner workings.
After running a couple of tests on an AMD Ryzen 1600 (6 cores, 12 threads) based machine, I compiled a short table with the results.
On this hardware, a ResultingSum of 68 takes Y time to render/generate X number of unique keys. The sweet-spots are marked in bold in the below table.
Results will differ for other ResultingSum values. For a value of 68, 30 000 unique keys are generated in under 9 seconds.
The going gets tougher when generating 150 000 unique keys in exactly 4 minutes. Oh lawd.
|Keys (X)||Time (ms, Y)||ms/key (=Y/X)|
Screenshots of app demoing the NuGet packages
Maybe not so much. After all, it’s WinForms in 2020.
The Barbez.eu license key generator is ideal if you’re in need of a decent number of license keys or serial numbers that are easy and quick to spell out to one another, and quick enough to generate.