swift-cidr 0.5.0 adds public value types for exact inclusive IP address ranges
and normalized exact address coverage. These APIs complement canonical CIDR
prefixes without changing the meaning or behavior of existing types.
Highlights
- Adds
IPAddressRange<Family>, withIPv4AddressRangeand
IPv6AddressRangealiases, for exact inclusive address intervals. - Adds
IPAddressCoverage<Family>for normalized exact unions with
binary-search containment. - Adds
AnyIPAddressRangefor runtime-family parsing and mixed-family
boundaries. - Encodes and decodes
IPAddressRangeandAnyIPAddressRangeusing their
canonical single-string representation.IPAddressCoveragedeliberately has
no public wire shape. - Keeps
summarizedNetworks()as the exact range-to-CIDR bridge through
IPNetwork.summarize(from:to:).
Semantics
- Range text uses the strict, package-defined
lower...upperform. - Programmatic endpoints retain their literal address bits, not their original
prefix-length context. - Duplicate, contained, overlapping, and adjacent ranges coalesce without
covering a gap. - Mixed-family coalescing is deterministic and emits IPv4 ranges before IPv6
ranges. - Range-to-network summarization preserves exact covered addresses but need not
reproduce the prefix lengths of the original inputs.
Compatibility and migration
This release is additive. It does not raise the Swift tools version, supported
platform minimums, or dependency requirements.
Shared address-range ownership moves from CIDRMergeCore to CIDR for the
coordinated cidrmerge 0.2 and swift-cidr-admission 0.2 work. Downstream code
using these types should migrate from import CIDRMergeCore to import CIDR.
Installation
dependencies: [
.package(
url: "https://github.com/RouteObjects/swift-cidr.git",
from: "0.5.0"
)
]Validation
- Annotated
0.5.0tag is SSH-signed and GitHub-verified. - 167 tests across 21 suites pass in debug, release, and Linux configurations.
CIDR,CIDRPOSIX, andCIDRNIObuild successfully.- The
CIDRtarget cross-builds for the iOS 18 Simulator. - Public API compatibility against
0.4.0reports no breaking changes. - DocC validation passes with warnings treated as errors.
- New range and coverage currency benchmarks retain zero-allocation thresholds.
Full migration details are available in
Documentation/ReleaseNotes/0.5.0.md.