IntelliDataSort 1.0.0
dotnet add package IntelliDataSort --version 1.0.0
NuGet\Install-Package IntelliDataSort -Version 1.0.0
<PackageReference Include="IntelliDataSort" Version="1.0.0" />
<PackageVersion Include="IntelliDataSort" Version="1.0.0" />
<PackageReference Include="IntelliDataSort" />
paket add IntelliDataSort --version 1.0.0
#r "nuget: IntelliDataSort, 1.0.0"
#:package IntelliDataSort@1.0.0
#addin nuget:?package=IntelliDataSort&version=1.0.0
#tool nuget:?package=IntelliDataSort&version=1.0.0
IntelliDataSort โ HumanSort Engine
Secure, culture-aware sorting and parsing engine for real-world string data
IntelliDataSort (powered by HumanSort) is a high-precision sorting library for .NET designed to safely handle untrusted, mixed-format, and international string data.
It combines:
- Explicit type declaration (no ambiguous auto-detection)
- Strict validation
- Secure parsing
- Stable, human-friendly sorting
- Parsed output for filtering & auditing
Ideal for data grids, reports, logs, CSV/Excel imports, admin panels, and console tooling where correctness and security matter.
๐ What Problems Does It Solve?
Common issues with traditional sorting:
"file10"sorted before"file2""โน1,00,000"treated as invalid"04/07/2023"misinterpreted across cultures- Injection payloads silently accepted
- Mixed formats producing unstable results
HumanSort solves these with explicit type declaration and strict validation.
โจ Core Capabilities
Sorting Types
- Human-friendly natural string sorting
- Numeric sorting (int, decimal, scientific, hex, binary)
- Culture-aware date & time sorting
- Currency sorting with regional rules
- Percentage sorting with strict validation
- File size sorting (B โ YB, decimal & binary)
- IP address sorting (IPv4)
- Semantic version sorting (SemVer)
Filtering Support
- Parsed output exposed via
outparameter for post-sort filtering - Invalid values explicitly identified (
parsed = null) - No silent coercion or guessing
๐ฆ Installation (NuGet)
dotnet add package IntelliDataSort
๐ Quick Start
using IntelliDataSort;
var sorter = new HumanSort();
var data = new List<string>
{
"file10",
"file2",
"file1"
};
// REQUIRED: Explicitly specify column type
var result = sorter.Sort(
data,
HumanSort.ColumnType.NaturalString, // โ MANDATORY parameter
ascending: true,
nullHandling: HumanSort.NullHandling.NullsFirst
);
// Result: ["file1", "file2", "file10"]
โ ๏ธ Critical API Change: Explicit Type Declaration Required
forceType is now a REQUIRED non-nullable parameter.
Auto-detection has been removed to prevent silent failures and ambiguous behavior.
โ Correct usage:
sorter.Sort(data, HumanSort.ColumnType.Number, true);
โ Will not compile:
// Missing required forceType parameter
sorter.Sort(data, true);
Why this change? Ambiguous inputs like
"1.234"could mean1.234(decimal) or1234(thousands separator) depending on culture. HumanSort requires explicit intent to guarantee deterministic results.
๐งฉ Supported Column Types
| ColumnType | Description | Example Values |
|---|---|---|
Number |
Integers, decimals, scientific notation | 123, -45.67, 1.23e4, 0xFF |
DateTime |
Culture-aware date & time parsing | 2023-07-04, 04/07/2023 |
Currency |
Symbol & ISO-aware currency parsing | $100, โน1,00,000, 100 EUR |
Percentage |
Strict % parsing | 10%, (15%), 25 pct |
FileSize |
B โ YB (decimal & binary) | 1 KB, 1 MiB, 0.5 GB |
IpAddress |
Exact IPv4 sorting | 192.168.1.1, 10.0.0.1 |
NaturalString |
Human-friendly alphanumeric sorting | file1, file10, doc_v2 |
Version |
Semantic versioning (SemVer) | 1.0.0, 2.0.0-beta, 3.14.159 |
PlainString |
Ordinal string comparison | "apple", "banana" |
๐ฑ Currency Sorting
var data = new List<string>
{
"(โน1,00,000)",
"โน10",
"โน1,00,00,000"
};
var result = sorter.Sort(
data,
HumanSort.ColumnType.Currency,
ascending: true,
nullHandling: HumanSort.NullHandling.NullsFirst
);
โ Parentheses negatives: (โน100) โ -100
โ Indian numbering system (lakh/crore)
โ Strict validation (rejects ambiguous inputs)
โ No mixed-currency coercion
๐ Date Sorting (Culture-Aware)
var culture = new CultureInfo("en-GB"); // Day-first culture
var data = new List<string>
{
"04/07/2023", // 4 July 2023 (not April!)
"01/12/2024",
"07/08/2022"
};
var result = sorter.Sort(
data,
HumanSort.ColumnType.DateTime,
ascending: true,
nullHandling: null,
dateTimeCulture: culture, // โ Only valid for DateTime
out var parsedValues
);
โ ๏ธ
dateTimeCultureparameter is only accepted whenforceType = ColumnType.DateTime. Using it with other types throwsArgumentException.
๐ Percentage Sorting
var data = new List<string>
{
"10%",
"(15%)", // โ -15
"25 pct",
"50 percent"
};
var result = sorter.Sort(
data,
HumanSort.ColumnType.Percentage,
ascending: true
);
Accepted: 10%, (15%), 25 pct, 50 percent, -30%
Rejected: 100 (no % indicator), $50, 10% KB, percent 50
๐งช Parsed Values Output
All sort operations support an out parameter for parsed values:
var result = sorter.Sort(
data,
HumanSort.ColumnType.Number,
ascending: true,
nullHandling: null,
out List<(string original, object parsed)> parsedValues
);
// Inspect parsed values for filtering/auditing
foreach (var (original, parsed) in parsedValues)
{
Console.WriteLine($"{original} โ {parsed ?? "INVALID"}");
}
| Input | Parsed Value Type | Notes |
|---|---|---|
| Valid item | double, DateTime, etc. |
Type matches ColumnType |
| Invalid | null |
Explicitly marked invalid |
๐ Security Model
Zero-trust input philosophy: Ambiguous or potentially malicious inputs are rejected, not guessed.
Actively Rejected Inputs
- SQL injection attempts (
' OR 1=1 --) - XSS/script payloads (
<script>) - HTML/XML fragments
- Unicode control/invisible characters
- Mixed units (
100$โฌ) - Extreme numeric values (DoS prevention)
- Scientific notation in currencies (
$1e5) - Roman numerals with currency symbols (
$X)
Security Note: This parser implements strict allow-list validation per OWASP guidelines. It reduces injection risk at the input boundary but does not replace downstream security controls (parameterized queries, output encoding, access control).
โ๏ธ Public API Surface
Visible Types (Users Can Access)
namespace IntelliDataSort
{
public sealed class HumanSort
{
public enum ColumnType { ... }
public enum NullHandling { ... }
public enum NaturalSortCaseSensitivity { ... }
public HumanSort();
public IReadOnlyList<string> Sort(
IEnumerable<string> data,
ColumnType forceType, // โ REQUIRED (non-nullable)
bool ascending = true,
NullHandling? nullHandling = null
);
public IReadOnlyList<string> Sort(
IEnumerable<string> data,
ColumnType forceType,
bool ascending,
NullHandling? nullHandling,
out List<(string original, object parsed)> parsedValues
);
public IReadOnlyList<string> Sort(
IEnumerable<string> data,
ColumnType forceType,
bool ascending,
NullHandling? nullHandling,
CultureInfo dateTimeCulture, // โ DateTime only
out List<(string original, object parsed)> parsedValues
);
// ===== VALIDATION METHODS =====
public bool IsValidCurrencyLiteral(string input);
public bool IsValidCurrencyLiteral(string input, string expectedCurrencyCode);
public static bool IsValidIpAddressExact(string input);
public IReadOnlyCollection<string> GetCurrencySymbols();
public IReadOnlyCollection<string> GetCurrencyCodes();
}
}
Hidden Implementation Details
- All validators (
NumberValidator,CurrencyValidator, etc.) โinternal - All helpers (
VersionParser,TokenListComparer, etc.) โprivate/internal - Configuration classes โ
private sealed - Regex patterns & dictionaries โ
private static readonly
๐งพ License
Proprietary License
ยฉ 2026 Mohd Nasrullah Kazmi (IntelliDataSort).
All rights reserved.
Unauthorized copying, modification, distribution, or commercial use is prohibited unless explicitly permitted by the author.
| 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 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. net9.0 was computed. 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 was computed. 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. |
-
net6.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.0.0 | 97 | 2/7/2026 |