Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.11.0] - 2026-10-24

### Added
- `Zlib` and `ZlibError`: in-memory zlib, gzip and raw DEFLATE compression/decompression with framing selected by window bits (`Zlib.Framing`), using `import zlib`
- `CRC32Checksum`: CRC-32 as `UInt32` with incremental `update(_:with:)`
- `FallbackTextDecoder`, `TextDecodingStrategy`, `StringEncodingStrategy`, `DecodedText`, `TextDecoderRegistry` and `Data.decodedText(using:)`: decode bytes of unknown encoding (US-ASCII, UTF-8, Mac OS Roman, Windows-1252) with pluggable strategies and control-character stripping

### Changed
- `Gzip` is built on `Zlib`; the `@_silgen_name` zlib proxy and hand-written `z_stream` layout are removed
- `CRC32Strategy` uses `CRC32Checksum`
- `DesignAlgorithmsKit.version` is `1.11.0`
- README rewritten to match the code: purpose, products, platforms, dependencies, build/test, known issues

### Fixed
- `Gzip.compress` no longer overflows an integer literal on 32-bit targets

### Removed
- `docs/DESIGN_PATTERNS.md` and `docs/EXAMPLES.md` (examples used APIs that do not exist; superseded by the README)
- Committed `.swiftpm/xcode/xcuserdata` (now git-ignored)
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ One library product and target: **`DesignAlgorithmsKit`** (`Sources/DesignAlgori
| Behavioral patterns | `StrategyContext`, `BaseStrategy`, `BaseObservable`/`Observer`, `CommandInvoker`/`ClosureCommand`, `BaseHandler`/`BaseTypedHandler`, `ArrayIterator`/`TreeIterator`, `Visitor`/`Visitable`, `Mergeable`/`MergeStrategy`/`DefaultMerger` |
| Pipelines | `DataPipeline`, `AsyncDataPipeline`, `AnyAsyncPipelineStage`, `DynamicAsyncPipeline`, `PipelineError` |
| Async work | `ProcessingQueue`/`QueueItem`/`QueueProcessor`, `JobManager`, `TaskOrchestrator`/`DAGTask`, `ResourceCoordinator` |
| Hashing | `HashAlgorithm` (SHA-256, SHA-1, MD5, CRC-32), `HashComputation`, `HashStrategy`/`HashStrategyRegistry`, `SHA256`, `Data.sha256`/`sha256Hex` |
| Hashing | `HashAlgorithm` (SHA-256, SHA-1, MD5, CRC-32), `HashComputation`, `HashStrategy`/`HashStrategyRegistry`, `SHA256`, `Data.sha256`/`sha256Hex`, `CRC32Checksum` (`UInt32`, incremental) |
| Identifiers | `ULID`, `UUIDv5Generator` |
| Probabilistic filters | `BloomFilter`, `CountingBloomFilter`, `BloomFilterHashable` |
| Merkle tree | `MerkleTree`, `MerkleProof`, `MerkleHashable` |
| Graphs | `Graph<T>` (directed, BFS reachability, unreachable-node detection) |
| Compression | `Gzip` (in-memory GZIP via system zlib) |
| Compression | `Zlib`/`ZlibError` (zlib, gzip and raw DEFLATE framing by window bits, via system zlib), `Gzip` (in-memory GZIP) |
| Encryption | `HybridEncryption` (Curve25519 + HKDF-SHA256 + ChaCha20-Poly1305) |
| Text / paths | `FilenameTokenizer`, `GitObjectLayout` |
| Text / paths | `FilenameTokenizer`, `GitObjectLayout`, `FallbackTextDecoder`/`TextDecodingStrategy`/`StringEncodingStrategy`/`TextDecoderRegistry`, `Data.decodedText(using:)` |

## Platforms

Expand All @@ -41,9 +41,9 @@ One library product and target: **`DesignAlgorithmsKit`** (`Sources/DesignAlgori
```
- **How consumers reference DAK.** The canonical remote is `https://github.com/nibbleware/DesignAlgorithmsKit.git`, and `rickhohler/DesignAlgorithmsKit` redirects to it. Use a semver range:
```swift
.package(url: "https://github.com/nibbleware/DesignAlgorithmsKit.git", from: "1.10.0")
.package(url: "https://github.com/nibbleware/DesignAlgorithmsKit.git", from: "1.11.0")
```
The latest tag is `v1.10.0` (the current `main`).
The latest tag is `v1.11.0`.

## Usage

Expand Down Expand Up @@ -71,6 +71,18 @@ let id = UUIDv5Generator.generate(namespace: ns, name: "python.org")
// GZIP
let gz = try Gzip.compress(data: data)
let raw = try Gzip.decompress(data: gz)

// zlib with explicit framing (15 zlib, 31 gzip, -15 raw DEFLATE)
let deflated = try Zlib.compress(data: data, windowBits: -15)
let inflated = try Zlib.decompress(data: deflated, framing: .rawDeflate)
let crc32 = CRC32Checksum.checksum(data) // UInt32

// Text of unknown encoding: US-ASCII, UTF-8, Mac OS Roman, Windows-1252,
// control characters (except newlines and tabs) removed
let text = bytes.decodedText()
// Add your own character sets before or after the defaults
TextDecoderRegistry.shared.register(MyCharsetStrategy(), placement: .beforeDefaults)
let custom = TextDecoderRegistry.shared.decode(bytes)
```

## Build & test
Expand All @@ -81,15 +93,15 @@ swift test
```

- No other packages are needed to build DAK.
- Current baseline: `swift build` succeeds with two warnings, and `swift test` runs 313 XCTest tests and 1 swift-testing placeholder with 0 failures.
- Current baseline: `swift build` succeeds with two warnings, and `swift test` runs 343 XCTest tests and 1 swift-testing placeholder with 0 failures.
- `IntegrationCompressionTests` runs `/usr/bin/gzip` and `/usr/bin/gunzip`, so it needs macOS.

## Known issues

- `JobManager.cancel` does not stop a pending job; `TaskOrchestrator` never throws `taskFailure`; `ProcessingQueue` has a scheduling race; `ResourceCoordinator` releases locks late.
- Merkle proofs fail for unpaired leaves; Bloom filters trap on capacity 0, rate 0 or a negative `Int`; `Gzip.decompress` ignores the CRC and ISIZE trailer.
- `ULID` text is not compatible with the ULID specification.
- Platform claims are broader than tested, the `version` constant is stale (`1.3.0`), `WASMGuard.swift` is dead code, CRC/SHA code is duplicated, and the DocC catalog is not attached to the target.
- Platform claims are broader than tested, `WASMGuard.swift` is dead code, SHA code is duplicated, and the DocC catalog is not attached to the target.

## Documentation

Expand Down
299 changes: 0 additions & 299 deletions Sources/DesignAlgorithmsKit/Algorithms/Compression.swift

This file was deleted.

Loading
Loading