GithubHelp home page GithubHelp logo

pleonex / xdelta-sharp Goto Github PK

View Code? Open in Web Editor NEW
31.0 4.0 7.0 772 KB

Decompressor for delta encoding VCDIFF (RFC-3284) -- xdelta3 compatible.

Home Page: https://www.pleonex.dev/xdelta-sharp/

License: MIT License

C# 99.47% Dockerfile 0.53%
xdelta compression xdelta3 vcdiff rfc-3284

xdelta-sharp's Introduction

PleOps.XdeltaSharp Build and release GitHub

NOTE: At this stage, this projects can only decompress patch files. It cannot generate / compress.

PleOps.XdeltaSharp offers the possibility to apply delta/patch files with format VCDIFF, as described in the RFC 3284.

This project offers a library and a console application written in pure C# (no calls to C libraries). Making it compatible in every OS that can run a .NET runtime that implements .NET Standard 2.0 (.NET Framework, Mono and .NET).

Release Package
Stable Nuget
Preview Azure Artifacts

The project takes the name from xdelta. Another compression tool in C by Joshua MacDonald that implements the algorithm VCDIFF. It started as a port but due to huge difference between C and C#, dropped and restarted the development just by reading the specification.

Limitations

The latest version does not support:

  • Generate patch files.
  • Patch files with secondary compression. Use the -S argument in xdelta3.
  • Patch files for files bigger or equal to 4 GB.

Examples

  • Apply a patch file
using var input = new FileStream(inputFile, FileMode.Open);
using var patch = new FileStream(patchFile, FileMode.Open);
using var output = new FileStream(outputFile, FileMode.Create);

using var decoder = new Decoder(input, patch, output);
decoder.ProgressChanged += progress => Console.WriteLine($"Patching progress: {progress}";

decoder.Run();

Documentation

Feel free to ask any question in the project Discussion site!

Check our on-line API documentation.

Build

The project requires to build .NET 6.0 SDK and .NET Framework 4.8 or latest Mono. If you open the project with VS Code and you did install the VS Code Remote Containers extension, you can have an already pre-configured development environment with Docker or Podman.

To build, test and generate artifacts run:

# Only required the first time
dotnet tool restore

# Default target is Stage-Artifacts
dotnet cake

To just build and test quickly, run:

dotnet cake --target=BuildTest

License

This software is license under the MIT license.

Although not used, originally the project was inspired in xdelta with license Apache 2.0.

The algorithm for the ADLER32 checksum was ported from the C version of zlib with the following license:

Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly        Mark Adler
[email protected]          [email protected]

The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).

xdelta-sharp's People

Contributors

pleonex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xdelta-sharp's Issues

unavailable secondary compressor

Recent versions of xdelta3 apply some sort of secondary compression by default. xdelta-sharp clearly does not support this (throws exception about secondary compressor). I've spent couple hours fighting this issue, so i'm sharing my workaround for anyone who might be struggling with it.

Issue can be avoided by using -S argument of xdelta3 to disable secondary compression:

xdelta3 -e -S -s original_file modified_file output_patch

Might be worth mentioning in docs or in exception message itself?

does not do anything

i opened both xdeltasharp and create dump and both of them open and then close automaticly

Patching files > 4GiB

I was trying to patch a large file (4 448 220 211 bytes) with not so large xdelta, and it failed. Worth mentioning in limitations list i guess. By the way, any thoughts if it's difficult to support large files?

System.FormatException: decoder file offset overflow at
PleOps.XdeltaSharp.Decoder.WindowReader.CheckReadOverflow() at
PleOps.XdeltaSharp.Decoder.Decoder.Run() at
...

Push NuGet package to a public feed

As part of the release process, we should publish a NuGet package to nuget.org
This should be done after merging the branch changing the namespaces.

Discussed in #5

Originally posted by minexew November 16, 2021
Hi, any chance for a NuGet release? :)

We would like to use XdeltaSharp for Gnoll's mod installer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.