A utility library for .NET Framework 4.7.2 — string manipulation, numerics, collections,
cryptography, date/time, file I/O, system info, and certificate utilities, all in one package.
dotnet add package Kaz.OperationsInstall-Package Kaz.Operations| Namespace | Description |
|---|---|
Kaz.Operations.Text |
String editing, format validation (email, URL, IP, regex…) |
Kaz.Operations.Numerics |
Safe type conversion, clamp, lerp, factorial, prime check |
Kaz.Operations.Collections |
Merge/counting sort, linear/binary/interpolation search |
Kaz.Operations.Time |
Weekend/weekday checks, past/present/future, date validation |
Kaz.Operations.IO |
File CRUD, encoding control, directory validation |
Kaz.Operations.Security.Cryptography |
SHA-256/512, MD5, HMAC, PBKDF2 hashing |
Kaz.Operations.System |
Machine info, environment variables, system directories |
Kaz.Operations.Security.Certificates |
Load, validate, and inspect X.509 certificates |
Text
"abc".Reverse(); // "cba"
"example@gmail.com".IsEmail(); // true
"https://example.com".IsUrl(UrlScheme.Https); // trueNumerics
"19.99".ToNumericOrDefault<double>(0.0); // 19.99
10.Clamp(0, 5); // 5
7.IsPrime(); // trueCollections
var list = new List<int> { 5, 3, 8, 1 };
list.MergeSort(); // [1, 3, 5, 8]
list.BinarySearch(3); // index 1Cryptography
string hash = Sha256.Hash("hello world");
bool match = Sha256.Compare("hello world", hash); // true
byte[] salt = Pbkdf2.GenerateSalt();
string pwHash = Pbkdf2.HMACSHA256("my-password", salt, 10000);Time
new DateTime(2025, 1, 4).IsWeekend(); // true (Saturday)
DateTime.UtcNow.AddDays(-1).IsPastDate(); // true
"2025-01-01".IsValidDate(); // trueIO
CRUD.AppendLine("logs/app.log", "Started");
List<string> lines = CRUD.ReadAllLines("data/file.txt", skipEmpty: true);
Validation.EnsureExists("logs/archive"); // creates directory if missingSystem
bool isAdmin = SystemInfo.IsAdministrator;
double mb = SystemInfo.WorkingSetMb;
string path = EnvironmentVariables.GetVariable("PATH", "default");Certificates
var cert = X509CertificateInfo.LoadCertificate("mycert.pfx", "password");
bool trusted = cert.IsTrusted();
DateTime exp = cert.GetExpirationDate();- This project is distributed under the MIT License — free for personal and commercial use.
- If you want to contact me about the NuGet package, collaboration, or any development‑related questions, feel free to reach out through the links below:
