Pargoon.Utility
1.1.1
See the version list below for details.
dotnet add package Pargoon.Utility --version 1.1.1
NuGet\Install-Package Pargoon.Utility -Version 1.1.1
<PackageReference Include="Pargoon.Utility" Version="1.1.1" />
paket add Pargoon.Utility --version 1.1.1
#r "nuget: Pargoon.Utility, 1.1.1"
// Install Pargoon.Utility as a Cake Addin #addin nuget:?package=Pargoon.Utility&version=1.1.1 // Install Pargoon.Utility as a Cake Tool #tool nuget:?package=Pargoon.Utility&version=1.1.1
Pargoon.Utility
Pargoon.Utility is a utility library that provides various helpful functions for string manipulation, encryption, and more.
Features
- String manipulation utilities
- Encryption utilities
- Expiration-based encryption
- ObjectUtility
- RandomUtility
- RegXPattern
- TimeUtility
Installation
You can install the Pargoon.Utility library using NuGet package manager. Run the following command in the NuGet Package Manager Console:
Install-Package Pargoon.Utility
RegXPattern
This part contain some useful regular expression patterns.
StringUtility
Contain some extension methods for strings
ArrayUtility
Contain some useful extension methods for merging arrays to string
RandomUtils
Contain some useful function for generating random number and string
Usage
String Manipulation
using Pargoon.Utility;
string[] names = { "John", "Jane", "Michael" };
string mergedNames = names.MergeToString(names);
Console.WriteLine(mergedNames); // Output: John, Jane, Michael
Encryption
string password = "MyPassword123";
string encryptedPassword = PasswordHelper.EncryptPasswordMd5(password);
Console.WriteLine(encryptedPassword); // Output: 5F4DCC3B5AA765D61D8327DEB882CF99
string message = "Hello, World!";
string passphrase = "MySecretKey";
string encryptedMessage = PasswordHelper.EncryptString(message, passphrase);
string decryptedMessage = PasswordHelper.DecryptString(encryptedMessage, passphrase);
Console.WriteLine(decryptedMessage); // Output: Hello, World!
Expiration-based Encryption
string message = "Confidential data";
string passphrase = "MySecretKey";
TimeSpan expiration = TimeSpan.FromHours(1);
string encryptedWithExpiration = PasswordHelper.EncryptWithExpiration(message, passphrase, expiration);
string decryptedWithExpiration = PasswordHelper.DecryptWithExpiration(encryptedWithExpiration, passphrase);
Console.WriteLine(decryptedWithExpiration); // Output: Confidential data (within 1 hour of encryption)
StringUtility Examples
Here are some examples of using the StringUtility class methods:
bool containsEnglishLetters = "Hello123".IsEnglishLetter();
bool isValidUsername = "john_doe123".IsValidUsername();
bool isValidMobileNumber = "09123456789".IsValidMobileNumber();
bool isNumeric = "12345".IsNumeric();
bool isValidEmail = "test@example.com".IsValidEmail();
// Output: true
string fixedEmail = " test @example. com ".FixEmail();
// Output: "test@example.com"
string strippedString = "<p>Hello, <b>world!</b></p>".StripTags();
// Output: "Hello, world!"
string truncatedString = "Lorem ipsum dolor sit amet.".FixLength(10);
// Output: "Lorem ipsu..."
bool hasValue = " Hello World ".HasValue();
// Output: true
int numericValue = "12345".ToInt();
// Output: 12345
Contributing
Contributions to Pargoon.Utility are welcome! If you find any bugs, have feature requests, or want to contribute code improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Pargoon.Utility:
Package | Downloads |
---|---|
Pargoon.PersianDateUtility
Contain some useful function for working with persian date |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.5 | 537 | 8/18/2024 |
1.1.4 | 170 | 7/20/2024 |
1.1.1 | 195 | 5/31/2023 |
1.1.0 | 136 | 5/31/2023 |
1.0.9 | 437 | 9/3/2022 |
1.0.8 | 400 | 7/30/2022 |
1.0.7 | 400 | 7/30/2022 |
1.0.6 | 413 | 5/17/2022 |
1.0.5 | 377 | 5/17/2022 |
1.0.4 | 389 | 5/17/2022 |
1.0.3 | 1,010 | 5/17/2022 |
1.0.2 | 387 | 5/17/2022 |
1.0.1 | 389 | 5/17/2022 |
1.0.0 | 381 | 5/17/2022 |
adding encryption utility