Skip to content

swift-cidr 0.5.0

Latest

Choose a tag to compare

@camunro camunro released this 05 Aug 14:19
0.5.0
fd5116c

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>, with IPv4AddressRange and
    IPv6AddressRange aliases, for exact inclusive address intervals.
  • Adds IPAddressCoverage<Family> for normalized exact unions with
    binary-search containment.
  • Adds AnyIPAddressRange for runtime-family parsing and mixed-family
    boundaries.
  • Encodes and decodes IPAddressRange and AnyIPAddressRange using their
    canonical single-string representation. IPAddressCoverage deliberately 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...upper form.
  • 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.0 tag is SSH-signed and GitHub-verified.
  • 167 tests across 21 suites pass in debug, release, and Linux configurations.
  • CIDR, CIDRPOSIX, and CIDRNIO build successfully.
  • The CIDR target cross-builds for the iOS 18 Simulator.
  • Public API compatibility against 0.4.0 reports 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.