Arcus

GitHub Actions Workflow Status nuget Version GitHub Release GitHub Tag Targets .NET Standard 2.0, .NET 8, .NET 9, and .NET 10 Apache 2.0 License

Arcus is a C# manipulation library for calculating, parsing, formatting, converting, and comparing both IPv4 and IPv6 addresses and subnets. It accounts for 128-bit numbers on 32-bit platforms.

Arcus provides extension and helper methods for the pre-existing System.Net.IPAddress and other objects within that realm. It was created to fill in some of the gaps left by the absence of a representation of a Subnet. As more gaps were found, they were filled. Like all coding projects, Arcus is a work in progress. We rely on both our free time and our community in order to provide the best solution we can given the constraints we must conform to.

Hint

Chances are you’re primarily here looking for the Subnet object.

Arcus heavily relies upon one of our other libraries Gulliver, if you’re interested in byte manipulation it is worth checking out.

Warning

Breaking Changes in Version 3+

In .NET versions up to and including .NET 4.8 (which corresponds to .NET Standard 2.0), stricter parsing rules were enforced for IPAddress according to the IPv6 specification.Specifically, the presence of a terminal ‘%’ character without a valid zone index is considered invalid in these versions. As a result, the input abcd::% fails to parse, leading to a null or failed address parsing depending on Parse/TryParse. This behavior represents a breaking change from Arcus’s previous target of .NET Standard 1.3. and may provide confusion for .NET 4.8 / .NET Standard 2.0 versions.

In contrast, in newer versions of .NET, including .NET 8 and .NET 9, the parsing rules have been relaxed. The trailing ‘%’ character is now ignored during parsing, allowing for inputs that would have previously failed.

It is important to note that this scenario appears to be an extreme edge case, and developers should ensure that their applications handle IPAddress parsing appropriately across different target frameworks as expected.

If in doubt it is suggested that IP Address based user input should be sanitized to meet your development needs.

Additional Tools