Meyn.Utilities 10.0.1

dotnet add package Meyn.Utilities --version 10.0.1
                    
NuGet\Install-Package Meyn.Utilities -Version 10.0.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="Meyn.Utilities" Version="10.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meyn.Utilities" Version="10.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Meyn.Utilities" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meyn.Utilities --version 10.0.1
                    
#r "nuget: Meyn.Utilities, 10.0.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.
#:package Meyn.Utilities@10.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meyn.Utilities&version=10.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Meyn.Utilities&version=10.0.1
                    
Install as a Cake Tool

Meyn.Utilities

NuGet GitHub

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
10.0.1 195 11/23/2025
10.0.0 165 11/23/2025
8.0.1 130 10/25/2025
7.0.0 242 6/28/2025
6.0.0 447 12/16/2023
5.0.0 857 1/28/2023
4.0.0 482 12/25/2022
3.1.0 794 8/11/2022
3.0.0 529 8/11/2022
2.0.0 4,142 7/20/2022
1.0.0 555 7/20/2022