NextGenSoftware.Utilities 2.0.3

dotnet add package NextGenSoftware.Utilities --version 2.0.3
                    
NuGet\Install-Package NextGenSoftware.Utilities -Version 2.0.3
                    
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="NextGenSoftware.Utilities" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NextGenSoftware.Utilities" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="NextGenSoftware.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 NextGenSoftware.Utilities --version 2.0.3
                    
#r "nuget: NextGenSoftware.Utilities, 2.0.3"
                    
#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 NextGenSoftware.Utilities@2.0.3
                    
#: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=NextGenSoftware.Utilities&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=NextGenSoftware.Utilities&version=2.0.3
                    
Install as a Cake Tool

NextGenSoftware.Utilities

A broad shared utility library — string helpers, data conversion, encryption, key generation, validation, path resolution, directory tools, list helpers, and more. Used across every OASIS Omniverse project.

NuGet License: MIT .NET

Part of the OASIS Omniverse v2.0 Reboot. Visit oasisomniverse.one.


Installation

dotnet add package NextGenSoftware.Utilities

String Extension Methods

using NextGenSoftware.Utilities.ExtentionMethods;

"myVariableName".ToSnakeCase()   // "my_variable_name"
"my_variable".ToCamelCase()      // "myVariable"
"my_variable_name".ToPascalCase() // "MyVariableName"
Method Description
ToSnakeCase() Converts camelCase / PascalCase string to snake_case
ToCamelCase() Converts snake_case / spaced string to camelCase
ToPascalCase() Full PascalCase conversion — handles separators, runs of caps, numbers

StringHelper

bool ok = StringHelper.IsValidVersion("1.2.3");   // true
bool bad = StringHelper.IsValidVersion("1.2.3.4.5"); // false (max 4 parts)
Method Description
IsValidVersion(string) Validates a version string (up to 4 dot-separated integer parts)

DataHelper

string csv  = DataHelper.ConvertBinaryDataToString(bytes);          // "72,101,108,108,111"
string text = DataHelper.DecodeBinaryDataAsUTF8(bytes);             // "Hello"
string csv2 = DataHelper.ConvertBinaryDataToString(bytes, false);   // include zero bytes
Method Description
ConvertBinaryDataToString(byte[], bool) Comma-delimited decimal representation of bytes; optionally skip zero bytes
DecodeBinaryDataAsUTF8(byte[]) UTF-8 decode with null-byte stripping and trimming

FileEncryption (AES + RSA)

// AES file encryption
byte[] key = ...; byte[] iv = ...;
FileEncryption.EncryptFile("input.dat", "encrypted.dat", key, iv);
FileEncryption.DecryptFile("encrypted.dat", "output.dat", key, iv);
string text = FileEncryption.DecryptFile("encrypted.dat", key, iv); // returns string

// RSA string encryption (Windows CryptoServiceProvider)
string cipher = myString.Encrypt("MyKeyContainerName");
string plain  = cipher.Decrypt("MyKeyContainerName");
Method Description
EncryptFile(in, out, key, iv) AES-encrypt a file to disk
DecryptFile(in, out, key, iv) AES-decrypt a file to disk
DecryptFile(in, key, iv) AES-decrypt a file and return as string
Encrypt(this string, key) RSA-encrypt a string using a named key container
Decrypt(this string, key) RSA-decrypt a string using a named key container

KeyHelper — Blockchain Key Generation

var keypair = KeyHelper.GenerateKeyValuePairAndWalletAddress();
Console.WriteLine(keypair.PublicKey);            // hex-encoded secp256k1 public key
Console.WriteLine(keypair.PrivateKey);           // hex-encoded private key
Console.WriteLine(keypair.WalletAddressLegacy);  // P2PKH Bitcoin address (hex scriptPubKey)
Console.WriteLine(keypair.WalletAddressSegwitP2SH); // P2SH-SegWit address (hex scriptPubKey)

bool validPub  = KeyHelper.IsValidRsaPublicKey(pemString);
bool validPriv = KeyHelper.IsValidRsaPrivateKey(pemOrDerString);
Method Description
GenerateKeyValuePairAndWalletAddress() Generates a secp256k1 keypair + P2PKH and P2SH-SegWit Bitcoin wallet addresses
IsValidRsaPublicKey(string) Validates a PEM RSA public key
IsValidRsaPrivateKey(string) Validates a PEM or DER RSA private key (PKCS#8 or PKCS#1)

IKeyPairAndWallet

public interface IKeyPairAndWallet {
    string PublicKey { get; set; }
    string PrivateKey { get; set; }
    string WalletAddressLegacy { get; set; }
    string WalletAddressSegwitP2SH { get; set; }
}

WalletAddressHelper

string address = WalletAddressHelper.PrivateKeyToAddress(wifPrivateKey);
string address2 = WalletAddressHelper.PublicKeyToAddress(pubKeyHex);
Method Description
PrivateKeyToAddress(string) Derives a P2PKH address scriptPubKey hex from a WIF private key
PublicKeyToAddress(string) Derives a P2PKH address scriptPubKey hex from a compressed public key hex

ValidationHelper

bool valid = ValidationHelper.IsValidEmail("user@example.com"); // true
bool bad   = ValidationHelper.IsValidEmail("not-an-email");     // false
Method Description
IsValidEmail(string) RFC-compliant email validation using MailAddress + regex normalisation

URIHelper

bool exists = await URIHelper.ValidateUrlWithHttpClientAsync("https://oasisomniverse.one");
Method Description
ValidateUrlWithHttpClientAsync(string) HTTP HEAD request to check a URL is reachable; returns false on DNS/connection failure

ListHelper

List<string> list = ListHelper.ConvertToList("apple,banana,cherry");
string csv = ListHelper.ConvertFromList(list); // "apple,banana,cherry"
Method Description
ConvertToList(string) Splits a comma-delimited string into a List<string>
ConvertFromList<T>(List<T>) Joins a list into a comma-delimited string

EnumHelper

string newline = EnumHelper.GetEnumValues(typeof(ConsoleColor));
// "Black\nDarkBlue\nDarkGreen\n..."

string comma = EnumHelper.GetEnumValues(typeof(ConsoleColor), EnumHelperListType.ItemsSeperatedByComma);
// "Black, DarkBlue, DarkGreen, ... or White"

IEnumerable<EnumValue<ConsoleColor>> wrapped = EnumHelper.ConvertToEnumValueList(colours);
IEnumerable<ConsoleColor> unwrapped = EnumHelper.ConvertFromEnumValueList(wrapped);
Method Description
GetEnumValues(Type, EnumHelperListType) Returns all enum member names formatted as newline or comma-separated list
ConvertToEnumValueList<T>(IEnumerable<T>) Wraps enum values in EnumValue<T> for data binding
ConvertFromEnumValueList<T>(IEnumerable<EnumValue<T>>) Unwraps EnumValue<T> back to plain enum values

ExpandoObjectHelpers

using NextGenSoftware.Utilities.ExtentionMethods;

dynamic obj = new ExpandoObject();
ExpandoObjectHelpers.AddProperty(obj, "Name", "OurWorld");
ExpandoObjectHelpers.AddProperty(obj, "Name", "Updated"); // updates existing key
Console.WriteLine(obj.Name); // "Updated"
Method Description
AddProperty(ExpandoObject, string, object) Adds or updates a named property on an ExpandoObject

DirectoryHelper

DirectoryHelper.CopyFilesRecursively("C:/source", "C:/dest");
Method Description
CopyFilesRecursively(source, target) Recursively copies all files and subdirectories from source to target, creating missing directories

AppPathHelper

Reliable cross-platform app root and user data path resolution.

string appRoot  = AppPathHelper.ResolveAppRootDirectory();
string fullPath = AppPathHelper.ResolvePathFromAppRoot("config/settings.json");
string basePath = AppPathHelper.ResolveBasePath(appRoot, configured);
bool writable   = AppPathHelper.IsDirectoryWritable(appRoot);
string userData = AppPathHelper.GetUserDataRoot("my-app");
string subDir   = AppPathHelper.GetUserDataSubDirectory("my-app", "logs");
Method Description
ResolveAppRootDirectory() Returns the directory containing the running DLL; falls back through ProcessPath, Assembly.Location, CurrentDirectory
ResolvePathFromAppRoot(string) Combines app root with a relative path; absolute paths pass through unchanged
ResolveBasePath(appRoot, configured) Returns configured path if non-empty; falls back to appRoot
IsDirectoryWritable(string) Write-tests a directory by creating and deleting a temp file
GetUserDataRoot(string) Returns (and creates) %LocalAppData%/<appFolderName> (cross-platform)
GetUserDataSubDirectory(string, string) Returns (and creates) a named subdirectory under GetUserDataRoot

PathHelper

string normalized = PathHelper.NormalizePathFromConfig("some/forward/slash/path");
// On Windows: "some\forward\slash\path"
// On Linux/macOS: "some/forward/slash/path"
Method Description
NormalizePathFromConfig(string) Converts forward/back slashes to the OS directory separator; safe for JSON config paths

MIT — Copyright © NextGen Software Ltd 2019 - 2026

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (10)

Showing the top 5 NuGet packages that depend on NextGenSoftware.Utilities:

Package Downloads
NextGenSoftware.CLI.Engine

A feature-rich CLI engine providing colour output, animations, progress bars, ASCII art, working-message spinners, formatted tables, and more — the CLI backbone of the entire OASIS Omniverse ecosystem. Used internally by HoloNET, the OASIS API (85+ packages), STAR ODK, and OurWorld. Easy to drop into any .NET app needing rich CLI output. Part of the OASIS Omniverse at https://oasisomniverse.one -- Source: https://github.com/NextGenSoftwareUK/NextGenSoftware-Libraries

NextGenSoftware.Holochain.HoloNET.Client

The world's first .NET & Unity client for Holochain. Fully upgraded to Holochain 0.6.2 — supports Kitsune2 networking, QUIC transport, updated AdminWebsocket and AppWebsocket conductor APIs, WebSocket handshake authentication headers, and the new conductor YAML config format. Lightweight version: does not bundle the Holochain binaries. Use NextGenSoftware.Holochain.HoloNET.Client.Embedded if you want the conductor auto-started and managed for you.

NextGenSoftware.Holochain.HoloNET.Client.Embedded

The world's first .NET & Unity client for Holochain. Fully upgraded to Holochain 0.6.2 — supports Kitsune2 networking, QUIC transport, updated conductor APIs, and WebSocket handshake authentication headers. This version bundles hc.exe and holochain.exe (v0.6.2) so the Holochain Conductor is auto-started and managed for you. Set HolochainConductorMode.UseEmbedded to activate. For the lightweight version without binaries use NextGenSoftware.Holochain.HoloNET.Client.

NextGenSoftware.OASIS.API.DNA

Defines the OASISDNA class and all associated configuration objects that control every aspect of OASIS runtime behaviour: active provider list, Auto-FailOver and Auto-LoadBalancing rules, Auto-Replication and Auto-Sync settings, encryption levels, FAHRN routing, HolonicBraid mesh config, API keys, and more. OASIS_DNA.json is loaded at startup and can be hot-swapped at runtime. Part of the OASIS Omniverse at https://oasisomniverse.one

NextGenSoftware.Holochain.HoloNET.ORM

Powerful ORM built on top of HoloNET Client for Holochain. Enables rapid hApp development via HoloNETEntryBase, HoloNETAuditEntryBase, HoloNETCollection and HoloNETObservableCollection — call Load, Save, Delete with automatic change tracking and rollback. Upgraded to Holochain 0.7.0. Lightweight version: use NextGenSoftware.Holochain.HoloNET.ORM.Embedded if you want the conductor auto-started.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 288 7/14/2026
2.0.2 217 7/14/2026
2.0.1 207 7/14/2026
2.0.0 230 7/13/2026
1.2.1 5,902 5/26/2024
1.2.0 5,725 5/26/2024
1.1.0 1,505 5/22/2023
1.0.6 851 12/29/2022
1.0.5 1,960 12/28/2022
1.0.4 931 11/27/2022
1.0.3 8,046 8/25/2022
1.0.2 1,847 8/25/2022
1.0.1 1,154 8/23/2022
1.0.0 2,078 8/22/2022

## v2.0.1 — OASIS Omniverse Reboot (2026)

Part of the biggest NextGen Software release in years! The full OASIS Omniverse ecosystem — powering Our World, the OASIS API (85+ NuGet packages), HoloNET (Holochain .NET client), STAR ODK, and more — has been fully relaunched and rebranded at https://oasisomniverse.one/

After years of continuous development this is the first major v2 release, representing a complete overhaul and modernisation of the entire NextGen Software foundation.

### What's New in v2.0.1
- Added .NET 10 support: now multi-targeting net8.0, net9.0, and net10.0 for future-proof compatibility
- Copyright updated: NextGen Software Ltd 2019 - 2026
- Part of the unified OASIS Omniverse ecosystem at https://oasisomniverse.one/
- Significantly improved error handling, robustness, and API consistency
- Full alignment with the new OASIS Omniverse architecture (WEB4 through WEB10 API tiers)
- All packages updated with correct metadata, repository URLs, and project URLs
- Multiple bug fixes and stability improvements
- Open source under MIT licence — https://github.com/NextGenSoftwareUK/NextGenSoftware-Libraries