Oxtensions 1.1.0
dotnet add package Oxtensions --version 1.1.0
NuGet\Install-Package Oxtensions -Version 1.1.0
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="Oxtensions" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oxtensions" Version="1.1.0" />
<PackageReference Include="Oxtensions" />
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 Oxtensions --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Oxtensions, 1.1.0"
#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 Oxtensions@1.1.0
#: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=Oxtensions&version=1.1.0
#tool nuget:?package=Oxtensions&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Oxtensions
High-performance, production-ready .NET extension methods library.
π¦ Installation
dotnet add package Oxtensions
ποΈ Extension Categories
| Namespace | Class | Description |
|---|---|---|
Oxtensions.String |
StringExtensions |
Slug, masking, casing, validation, safe parsing β |
Oxtensions.Byte |
ByteExtensions |
Hex, Base64, MD5/SHA-256 hashing β |
Oxtensions.Date |
DateTimeExtensions Β· DateOnlyExtensions Β· DateTimeOffsetExtensions |
Unix timestamps, boundaries, workday navigation, ISO 8601 β |
Oxtensions.Collections |
ListExtensions Β· DictionaryExtensions Β· StackExtensions Β· QueueExtensions |
Chunking, pagination, merge, query string, stack/queue bulk ops β |
Oxtensions.Enum |
EnumExtensions |
Description/Display attribute, flags, safe parse β |
Oxtensions.DataTable |
DataTableExtensions |
Typed mapping with reflection cache, JSON export β |
Oxtensions.Generic |
GenericExtensions |
Null guards, deep clone, JSON, IN predicate β |
Oxtensions.Numeric |
IntExtensions Β· LongExtensions Β· DoubleExtensions Β· DecimalExtensions |
Sign, parity, clamp, prime, factorial, digits, rounding, currency β |
Oxtensions.Char |
CharExtensions |
Vowel/consonant, ASCII category, case and whitespace predicates β |
Oxtensions.Identifiers |
GuidExtensions |
IsEmpty, ToShortString, NewComb (time-ordered GUID) β |
Oxtensions.Durations |
TimeSpanExtensions Β· IntDurationExtensions Β· LongDurationExtensions |
IsPositive/Negative/Zero, Abs, TotalWeeks, fluent builders β |
Oxtensions.Streams |
StreamExtensions Β· ByteStreamExtensions |
ToByteArray, Base64, ReadAllText, GZip compress/decompress β |
Oxtensions.Async |
TaskExtensions |
FireAndForget, WithTimeout, WithCancellation, Retry β |
β‘ Quick Examples
using Oxtensions.Async;
using Oxtensions.Byte;
using Oxtensions.Char;
using Oxtensions.Collections;
using Oxtensions.DataTable;
using Oxtensions.Date;
using Oxtensions.Durations;
using Oxtensions.Enum;
using Oxtensions.Generic;
using Oxtensions.Identifiers;
using Oxtensions.Numeric;
using Oxtensions.Streams;
using Oxtensions.String;
// String
"Hello WΓΆrld! NaΓ―ve".ToSlug(); // "hello-world-naive"
"1234567890123456".Mask(4, 4); // "1234********3456"
"hello world".ToPascalCase(); // "HelloWorld"
"user@example.com".IsValidEmail(); // true
// Byte
byte[] data = Encoding.UTF8.GetBytes("hello");
data.ToHexString(); // "68656C6C6F"
data.ComputeSHA256().ToHexString(); // SHA-256 hex
// DateTime
new DateTime(2026, 2, 20).NextWorkday(); // 2026-02-23
946684800L.FromUnixTimestamp(); // 2000-01-01 00:00:00 UTC
// DateOnly
new DateOnly(2026, 2, 20).NextWorkday(); // 2026-02-23 (Friday β Monday)
new DateOnly(2026, 6, 15).StartOfYear(); // 2026-01-01
new DateOnly(2026, 6, 15).ToDateTime(); // 2026-06-15 00:00:00
// DateTimeOffset
DateTimeOffset.UtcNow.ToUnixTimestamp(); // Unix seconds
946684800L.ToDateTimeOffset(); // 2000-01-01T00:00:00+00:00
new DateTimeOffset(2026, 2, 22, 15, 0, 0, TimeSpan.FromHours(3)).ToIso8601String();
// "2026-02-22T15:00:00+03:00"
// Collections β List
new[] {1,2,3,4,5}.Chunk(2); // [[1,2],[3,4],[5]]
items.Paginate(0, 10); // first 10 items
// Collections β Dictionary
dict.GetOrDefault("key", "fallback");
dict.Merge(otherDict, overwrite: true);
new Dictionary<string,string>{{"q","hello"}}.ToQueryString(); // "q=hello"
// Enum
MyEnum.Active.GetDescription(); // [Description] attribute value
MyEnum.Active.GetDisplayName(); // [Display(Name=)] attribute value
// DataTable
var users = dataTable.ToList<User>(); // reflection-cached mapping
var json = dataTable.ToJson();
// Generic
person.ThrowIfNull(nameof(person));
5.In(1, 3, 5, 7); // true
original.Clone(); // deep copy via System.Text.Json
// Numeric (int / long / double)
7.IsPrime(); // true
5.Factorial(); // 120
1234.ToDigits(); // [1, 2, 3, 4]
42.IsBetween(1, 100); // true
double.NaN.IsNaN(); // true
3.14d.RoundTo(1); // 3.1
// Numeric (decimal)
1234.56m.ToCurrencyString("en-US"); // "$1,234.56"
150m.Clamp(0m, 100m); // 100
25m.Percentage(200m); // 12.5
(-42.5m).Abs(); // 42.5
// Char
'a'.IsVowel(); // true
'Z'.IsConsonant(); // true
'5'.IsAsciiDigit(); // true
// Identifiers (Guid)
Guid.Empty.IsEmpty(); // true
Guid.NewGuid().ToShortString(); // 22-char Base64URL
Guid.NewComb(); // time-ordered GUID
// Durations (TimeSpan)
TimeSpan.FromSeconds(-5).Abs(); // 00:00:05
5.Days() + 3.Hours(); // 5.03:00:00
10.Minutes().ToHumanReadable(); // "10 minutes"
// Streams
byte[] data = File.ReadAllBytes("file.bin");
byte[] compressed = data.CompressGzip();
byte[] back = compressed.DecompressGzip();
// Async
await SomeWork().FireAndForget();
await SomeWork().WithTimeout(TimeSpan.FromSeconds(5));
await SomeWork().Retry(maxAttempts: 3, delay: TimeSpan.FromMilliseconds(500));
// Collections (Stack)
var stack = new Stack<int>();
stack.PushRange(new[] { 1, 2, 3 }); // top = 3
stack.PeekOrDefault(-1); // 3 (no remove)
stack.PopMany(2); // [3, 2]
stack.Clone(); // independent copy
// Collections (Queue)
var queue = new Queue<string>();
queue.EnqueueRange(new[] { "a", "b", "c" });
queue.PeekOrDefault("(empty)"); // "a" (no remove)
queue.DequeueMany(2); // ["a", "b"]
queue.Clone(); // independent copy
ποΈ Project Structure
Oxtensions.sln
βββ src/
β βββ Oxtensions/
β βββ String/ StringExtensions.cs
β βββ Byte/ ByteExtensions.cs
β βββ Char/ CharExtensions.cs
β βββ Date/
β β βββ DateTime/ DateTimeExtensions.cs
β β βββ DateOnly/ DateOnlyExtensions.cs
β β βββ DateTimeOffset/ DateTimeOffsetExtensions.cs
β βββ Collections/
β β βββ List/ ListExtensions.cs
β β βββ Dictionary/ DictionaryExtensions.cs
β β βββ Stack/ StackExtensions.cs
β β βββ Queue/ QueueExtensions.cs
β βββ DataTable/ DataTableExtensions.cs
β βββ Enum/ EnumExtensions.cs
β βββ Generic/ GenericExtensions.cs
β βββ Guid/ GuidExtensions.cs
β βββ TimeSpan/
β β βββ TimeSpanExtensions.cs
β β βββ IntDurationExtensions.cs
β β βββ LongDurationExtensions.cs
β βββ Stream/
β β βββ StreamExtensions.cs
β β βββ ByteStreamExtensions.cs
β βββ Async/ TaskExtensions.cs
β βββ Numeric/
β βββ Int/ IntExtensions.cs
β βββ Long/ LongExtensions.cs
β βββ Double/ DoubleExtensions.cs
β βββ Decimal/ DecimalExtensions.cs
βββ tests/
βββ Oxtensions.Tests/
βββ String/ StringExtensionsTests.cs
βββ Byte/ ByteExtensionsTests.cs
βββ Char/ CharExtensionsTests.cs
βββ Date/ DateTimeExtensionsTests.cs
β DateOnlyExtensionsTests.cs
β DateTimeOffsetExtensionsTests.cs
βββ Collections/ ListExtensionsTests.cs
β DictionaryExtensionsTests.cs
β StackExtensionsTests.cs
β QueueExtensionsTests.cs
βββ DataTable/ DataTableExtensionsTests.cs
βββ Enum/ EnumExtensionsTests.cs
βββ Generic/ GenericExtensionsTests.cs
βββ Guid/ GuidExtensionsTests.cs
βββ TimeSpan/ TimeSpanExtensionsTests.cs
βββ Stream/ StreamExtensionsTests.cs
βββ Async/ TaskExtensionsTests.cs
βββ Numeric/
βββ IntExtensionsTests.cs
βββ LongExtensionsTests.cs
βββ DoubleExtensionsTests.cs
βββ DecimalExtensionsTests.cs
π§ͺ Running Tests
# All frameworks
dotnet test
# Specific framework
dotnet test --framework net10.0
# Specific class
dotnet test --filter "ClassName=StringExtensionsTests"
Test coverage: 676 tests across 5 frameworks (net6.0 Β· net7.0 Β· net8.0 Β· net9.0 Β· net10.0)
π§ Engineering Highlights
- Zero-allocation paths β
ArrayPool<T>,stackalloc,string.Create,Span<T>throughout - Reflection cache β
ConcurrentDictionary<Type, ...>inDataTableExtensionsandEnumExtensions - Span-based parsing β all
TryParsecalls use.AsSpan()overloads - Pre-compiled regex β all regex patterns are
static readonlywithRegexOptions.Compiled - Thread-safe β stateless extension methods; no shared mutable state
- Nullable-aware β
#nullable enableon all files, null-safe public APIs
π License
MIT Β© 2026 Oxara
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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 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.
-
net10.0
- No dependencies.
-
net6.0
- System.Text.Json (>= 8.0.5)
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 109 | 2/24/2026 |