Meyn.Utilities
10.0.1
dotnet add package Meyn.Utilities --version 10.0.1
NuGet\Install-Package Meyn.Utilities -Version 10.0.1
<PackageReference Include="Meyn.Utilities" Version="10.0.1" />
<PackageVersion Include="Meyn.Utilities" Version="10.0.1" />
<PackageReference Include="Meyn.Utilities" />
paket add Meyn.Utilities --version 10.0.1
#r "nuget: Meyn.Utilities, 10.0.1"
#:package Meyn.Utilities@10.0.1
#addin nuget:?package=Meyn.Utilities&version=10.0.1
#tool nuget:?package=Meyn.Utilities&version=10.0.1
Meyn.Utilities
A collection of common utilities and extensions for .NET applications.
Repository: https://github.com/prmeyn/CommonUtilities
Installation
dotnet add package Meyn.Utilities
Features
Cryptography Utilities (CryptoUtils)
Provides helper methods for random number generation, hashing, and encoding.
using Common.Utilities;
// Generate a random numeric string of a specific length
string randomNum = CryptoUtils.GetRandomNumber(6); // e.g., "123456"
// Compute SHA-512 hash
string hash = CryptoUtils.ComputeSha512Hash("password123");
// Base64 Encoding/Decoding
string base64 = CryptoUtils.ToBase64("Hello World");
string plain = CryptoUtils.FromBase64(base64);
General Utilities (Utils)
Template Substitution
Replace placeholders in a string with values from a dictionary. Placeholders should be in the format ##Key##.
using Common.Utilities;
var template = "Hello ##Name##, welcome to ##City##!";
var args = new Dictionary<string, string>
{
{ "Name", "John" },
{ "City", "New York" }
};
string result = Utils.SubstituteTemplate(template, args);
// Output: "Hello John, welcome to New York!"
HTTP Extensions (HttpContextExtensions)
Get Public IP
Retrieves the client's public IP address from HttpContext, checking various headers (Cloudflare, X-Forwarded-For) and handling local loopback addresses.
using Meyn.Utilities.Extensions;
// Inside a Controller or Middleware
string ipAddress = HttpContext.GetPublicIP();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Meyn.Utilities:
| Package | Downloads |
|---|---|
|
UmbracoMongoTokenManager
Package Description |
|
|
SMSwitch
Package Description |
|
|
MongoDbTokenManager
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.