{"id":20770568,"url":"https://github.com/ably/delta-codec-cocoa","last_synced_at":"2025-12-25T00:41:05.811Z","repository":{"id":46192427,"uuid":"206761016","full_name":"ably/delta-codec-cocoa","owner":"ably","description":"Cocoa VCDiff decoder","archived":false,"fork":false,"pushed_at":"2022-08-18T10:17:50.000Z","size":277,"stargazers_count":1,"open_issues_count":1,"forks_count":4,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-02-18T15:21:59.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ably.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-06T09:31:52.000Z","updated_at":"2021-11-08T13:28:02.000Z","dependencies_parsed_at":"2022-09-13T20:11:28.230Z","dependency_job_id":null,"html_url":"https://github.com/ably/delta-codec-cocoa","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fdelta-codec-cocoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fdelta-codec-cocoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fdelta-codec-cocoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fdelta-codec-cocoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ably","download_url":"https://codeload.github.com/ably/delta-codec-cocoa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104204,"owners_count":20236943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T12:10:27.525Z","updated_at":"2025-12-25T00:41:05.737Z","avatar_url":"https://github.com/ably.png","language":"Objective-C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AblyDeltaCodec\n\n\u003ca href=\"https://github.com/ably/delta-codec-cocoa/actions\"\u003e\n  \u003cimg src=\"https://github.com/ably/delta-codec-cocoa/workflows/Build/badge.svg\" /\u003e\n\u003c/a\u003e\n\nCocoa **VCDiff decoder**.\n\nUses [Xdelta version 3](https://github.com/ably-forks/xdelta/tree/xdelta-cocoa), a C library - forked by Ably - for delta compression using VCDIFF/[RFC 3284](https://tools.ietf.org/html/rfc3284) streams.\n\n## Objective-C example\n\n```objc\n@import AblyDeltaCodec;\n\nNSError *error;\nARTDeltaCodec *codec = [[ARTDeltaCodec alloc] init];\n[codec setBase:baseData withId:@\"m1\"];\nNSData *outputData = [codec applyDelta:deltaData deltaId:@\"m2\" baseId:@\"m1\" error:\u0026error];\n\n// Output data is an utf-8 string:\nNSString *output = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];\n```\n\n## Swift example\n\n```swift\nimport AblyDeltaCodec\n\nlet codec = ARTDeltaCodec()\ncodec.setBase(baseData, withId: \"m1\")\n\ndo {\n    let outputData = try codec.applyDelta(deltaData, deltaId: \"m2\", baseId: \"m1\")\n    // Output data is an utf-8 string:\n    let output = String(data: outputData, encoding: .utf8)\n}\ncatch {\n    print(error)\n}\n```\n\n# API Reference\n\n- [class `isDelta`](#class-isdelta)\n- [class `applyDelta`](#class-applydelta)\n- [`setBase`](#setbase)\n- [`applyDelta`](#applydelta)\n\n## Stateless\n\n### class isDelta\n\n\u003e ###### DECLARATION\n\u003e\n\u003e **Objective-C**\n\u003e\n\u003e +(BOOL)isDelta:delta;\n\u003e\n\u003e **Swift**\n\u003e\n\u003e class func isDelta(_ delta: Data) -\u003e Bool\n\n**Arguments**:\n\n* `delta`: `NSData`/`Data` (is a binary encoded as **vcdiff**, as specified in RFC 3284.)\n\n**Return Value**:\n\nReturns a `BOOL`/`Boolean` telling if it's a valid delta or not.\n\n### class applyDelta\n\n\u003e ###### DECLARATION\n\u003e\n\u003e **Objective-C**\n\u003e\n\u003e +(NSData *)applyDelta:current previous:previous error:error;\n\u003e\n\u003e **Swift**\n\u003e\n\u003e class func applyDelta(_ current: Data, previous: Data) -\u003e Data (throws)\n\n**Arguments**:\n\n* `current`: `NSData`/`Data` (is the binary encoding of the information needed to transform the source to the target. It is encoded as vcdiff, as specified in RFC 3284.)\n* `previous`: `NSData`/`Data` (is the group of bytes to transform into the target.)\n* `error`: `NSError` (Objective-C only) (is the error object when something goes wrong. It's nullable so it's optional.)\n\n**Return Value**:\n\nReturns a `NSData`/`Data` object of the target. It can return `nil`.\n\n## Stateful\n\n### setBase\n\n\u003e ###### DECLARATION\n\u003e\n\u003e **Objective-C**\n\u003e\n\u003e -(void)setBase:base withId:baseId;\n\u003e\n\u003e **Swift**\n\u003e\n\u003e func setBase(_ base: Data, withId baseId: Data)\n\n**Arguments**:\n\n* `base`: `NSData`/`Data` (is the group of bytes to transform into the target. This is probably an old, cached version.)\n* `baseId`: `NSString`/`String` (is an identifier of the base.)\n\n**Return Value**:\n\nReturns nothing.\n\n### applyDelta\n\n\u003e ###### DECLARATION\n\u003e\n\u003e **Objective-C**\n\u003e\n\u003e -(NSData *)applyDelta:delta deltaId:deltaId baseId:baseId error:error;\n\u003e\n\u003e **Swift**\n\u003e\n\u003e func applyDelta(_ delta: Data, deltaId deltaId: String, baseId baseId: String) -\u003e Data (throws)\n\n**Arguments**:\n\n* `delta`: `NSData`/`Data` (is the binary encoding of the information needed to transform the source to the target. It is encoded as vcdiff, as specified in RFC 3284.)\n* `deltaId`: `NSString`/`String` (is an identifier of the delta.)\n* `baseId `: `NSString`/`String` (is an identifier of the base used to verify if it matches with the current assigned base.)\n* `error`: `NSError` (Objective-C only) (is the error object when something goes wrong. It's nullable so it's optional.)\n\n**Return Value**:\n\nReturns a `NSData` object of the target. It can return `nil`.\n\n**Acknowledgments**:\n\nThe `delta` will be the new `base`.\n\n## We use both `Xcodeproj` and `Package.swift`\n\nWe currently have both these files, each contain their own build configuration/ settings. This means one build may succeed whereas the other may fail. This is required because Carthage and Cocoapods use `Xcodeproj` but SPM uses the `Package.swift`.\n\n## Release Process\n\nFor each release, the following needs to be done:\n\n* Create a new branch release/x.x.x (where x.x.x is the new version number) from the main branch\n* Bump the version numbers in `AblyDeltaCodec.podspec` and in the Xcode project. Commit this.\n* Run [`github_changelog_generator`](https://github.com/github-changelog-generator/github-changelog-generator) to automate the update of the [CHANGELOG](./CHANGELOG.md). This may require some manual intervention, both in terms of how the command is run and how the change log file is modified. Your mileage may vary:\n    * The command you will need to run will look something like this: `github_changelog_generator -u ably -p ably-cocoa --since-tag 1.2.5 --output delta.md`\n    * Using the command above, `--output delta.md` writes changes made after `--since-tag` to a new file\n    * The contents of that new file (`delta.md`) then need to be manually inserted at the top of the `CHANGELOG.md`, changing the \"Unreleased\" heading and linking with the current version numbers\n    * Also ensure that the \"Full Changelog\" link points to the new version tag instead of the `HEAD`\n    * Commit this change: `git add CHANGELOG.md \u0026\u0026 git commit -m \"Update change log.\"`\n* Push both commits to origin: `git push -u origin release/x.x.x`\n* Make a pull request against `main` and await approval of reviewer(s)\n* Once approved and/or any additional commits have been added, merge the PR\n* Steps to perform *before* pushing a release tag up:\n  * Build the Swift Package locally: Run `swift build` or `open Package.swift` and build the library with Xcode. This ensures this library will build for applications using Swift Package Manafer.\n  * Build the Xcode Project: `open DeltaCodec.xcodeproj` and build the library with Xcode. This ensures the library will build for applications using Carthage.\n  * Run `pod lib lint` to validate the Podspec and ensure the library will build for Cocoapods.\n  * Warning: Currently, there are 14 warnings related to the `xdelta3` submodule. We run `pod lib lint --allow-warnings` instead.\n  * Test the library integration in projects: SPM (in an Xcode project), Cocoapods (in a podfile) and Carthage (in a cartfile).\n* If any fixes are needed (e.g. the lint fails with warnings) then either commit them to `main` branch now if they are simple warning fixes or perhaps consider raising a new PR if they are complex or likely to need review.\n* Create a tag for this version number using `git tag x.x.x`\n* Push the tag using `git push origin x.x.x`\n* Release an update for CocoaPods using `pod trunk push AblyDeltaCodec.podspec --allow-warnings`. Details on this command, as well as instructions for adding other contributors as maintainers, are at [Getting setup with Trunk](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) in the [CocoaPods Guides](https://guides.cocoapods.org/)\n* Add to [releases](https://github.com/ably/delta-codec-cocoa/releases)\n  * refer to previous releases for release notes format\n* Test the integration of the library in a Xcode project using Carthage and CocoaPods using the [installation guide](https://github.com/ably/ably-cocoa#installation-guide)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fdelta-codec-cocoa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fably%2Fdelta-codec-cocoa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fdelta-codec-cocoa/lists"}