Pargoon.Utility 1.1.1

dotnet add package Pargoon.Utility --version 1.1.1
NuGet\Install-Package Pargoon.Utility -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pargoon.Utility" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pargoon.Utility --version 1.1.1
#r "nuget: Pargoon.Utility, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 159 5/31/2023
1.1.0 113 5/31/2023
1.0.9 410 9/3/2022
1.0.8 371 7/30/2022
1.0.7 374 7/30/2022
1.0.6 386 5/17/2022
1.0.5 351 5/17/2022
1.0.4 362 5/17/2022
1.0.3 940 5/17/2022
1.0.2 359 5/17/2022
1.0.1 359 5/17/2022
1.0.0 355 5/17/2022

adding encryption utility