Skip to content

swift-cidr 0.6.0

Choose a tag to compare

@camunro camunro released this 19 Aug 02:40
· 33 commits to main since this release
0.6.0
ecff180

swift-cidr 0.6.0 adds fixed-size, network-byte-order octet adapters to
IPv4Address and IPv6Address while retaining integer storage as the canonical
representation for identity and CIDR math.

Highlights

  • Adds init(octets:prefixLength:) and octets for IPv4 using
    InlineArray<4, UInt8>.
  • Adds the corresponding IPv6 APIs using InlineArray<16, UInt8>.
  • Uses owned, most-significant-octet-first projections containing address bits
    only—not prefix length, network canonicalization, or IPv6 scope.
  • Defaults omitted prefix context to /32 for IPv4 and /128 for IPv6.
  • Preserves all address bits, including host bits, without changing equality,
    hashing, ordering, parsing, formatting, or Codable behavior.
  • Provides an exact, allocation-free, text-free boundary for packet, protocol,
    and foreign-function interoperability without making octets the primary math
    model.

Compatibility and migration

This release raises the package's minimum Swift tools version from 6.1 to 6.2,
the first version providing InlineArray. The package retains its macOS 15 and
iOS 18 deployment floors for existing APIs.

The new octet APIs require macOS 26, iOS 26, tvOS 26, watchOS 26, or visionOS
26 on Apple platforms. They are available on Linux with Swift 6.2 or later.
Consumers unable to adopt the Swift 6.2 package floor should remain on
swift-cidr 0.5.x.

The adapter is intentionally limited to IPv4Address and IPv6Address. It does
not change IPNetwork, AnyIPAddress, MAC-family types, CIDRPOSIX, or
CIDRNIO, and it models an owned projection rather than a borrowed view.

Installation

dependencies: [
    .package(
        url: "https://github.com/RouteObjects/swift-cidr.git",
        .upToNextMinor(from: "0.6.0")
    )
]

Validation

  • Annotated 0.6.0 tag is SSH-signed and GitHub-verified.
  • 176 tests across 22 suites pass.
  • Swift 6.2 minimum-toolchain and Swift 6.3 Linux CI lanes pass.
  • CIDR, CIDRPOSIX, and CIDRNIO build successfully.
  • macOS 26/Xcode 26.6 validation passes, including retained macOS 15 and iOS 18
    deployment-floor builds.
  • The public symbol graph adds exactly two initializers and two properties, with
    no storage, protocol, or IPNetwork additions.
  • Four adapter benchmarks pass their configured zero malloc,
    object-allocation, retain, and release gates.
  • DocC validation passes with warnings treated as errors.

The package-wide local benchmark check also reports eight existing,
host-sensitive IPv6 formatter p90 wall-clock deviations. The signed 0.5.0
baseline reproduces the same cases; no related formatter code or thresholds
changed in 0.6.0.

Full details are available in
Documentation/ReleaseNotes/0.6.0.md.