用于 Java 的 VCDIFF 或替代二进制 diff 格式

发布于 2024-07-26 03:49:58 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

人生戏 2024-08-02 03:49:58

您可以使用 badiff 生成二进制差异; 该网站是

http://badiff.org/

并且可以在 Maven Central 上使用。 它是 BSD 许可的,对于 OSS 和商业都非常友好。 使用的算法是本文中描述的 O(ND) diff 的分块版本:

http://www. xmailserver.org/diff2.pdf

diff 格式与其他格式并不特别兼容,但它会产生一些非常好的且非常小的差异。

图书馆的速度相当快; 在我的台式机上,它可以在 54 秒内生成两个随机 50MB 输入流的差异。 希望这足够快; 我认为这是相当令人印象深刻的,因为这是两个各有 5000 万个代币的代币流的比较。 badiff 在计算差异时将利用多个 CPU 核心。

免责声明:我是 badiff 的作者,所以我当然认为它很酷。 我总是乐于接受建议; 诸如能够读取/写入“标准”二进制差异格式之类的事情听起来像是在即将发布的版本中添加的很酷的新功能。

You can generate binary diffs using badiff; the website is

http://badiff.org/

and it is available on maven central. It's BSD licensed, so friendly for both OSS and commercial. The algorithm used is a chunked version of the O(ND) diff described in this paper:

http://www.xmailserver.org/diff2.pdf

The diff format isn't particularly compatible with anything else, but it produces some really good and really small diffs.

The library is pretty fast; on my desktop machine it can generate a diff for two random 50MB input streams in 54 seconds. Hopefully that's fast enough; I think it's reasonably impressive since that's a comparison of two token streams of 50 million tokens each. badiff will take advantage of multiple CPU cores when computing diffs.

disclaimer: I'm the author of badiff, so of course I think it's cool. I'm always open to suggestions; things like being able to read/write "standard" binary diff formats sound like cool new features to add in upcoming releases.

漫雪独思 2024-08-02 03:49:58

我有一个用 C# 编写的 VCDIFF 解码器,如果有帮助的话,移植到 Java 可能相当简单。 它是 MiscUtil 的一部分,但我不认为它依赖于在 MiscUtil 的任何其他位上(或者至少是最低限度)。

不幸的是,我从来没有抽出时间来编写编码器,这显然相当困难 - 并且在我们的情况下没有必要(我们需要在移动设备上应用 .NET 中的补丁,但可以在服务器上按照我们想要的方式创建它们) 。

I have a decoder for VCDIFF written in C#, which would probably be fairly straightforward to port to Java, if that's any help. It's part of MiscUtil but I don't think it relies on any other bits of MiscUtil (or only minimally, anyway).

Unfortunately I never got round to writing an encoder, which is obviously rather harder - and wasn't necessary in our case (where we needed to apply patches in .NET on a mobile device, but could create them however we wanted at the server).

笔落惊风雨 2024-08-02 03:49:58

我将 MiscUtil 的 vcdiff 解码器移植到了 java 中。
https://github.com/xiaxiaocao/jvcdiff
更新:现在它还有一个vcdiff编码器

I hava ported MiscUtil's vcdiff decoder to java.
https://github.com/xiaxiaocao/jvcdiff
update: now it also have a vcdiff encoder

独闯女儿国 2024-08-02 03:49:58

xdelta 有一个 java 端口:
http://sourceforge.net/projects/javaxdelta/

但我不能对其质量说什么- 我还没试过。

There is a java-port of xdelta:
http://sourceforge.net/projects/javaxdelta/

But i can not say anything on its quality - i did not try it yet.

居里长安 2024-08-02 03:49:58

我在 Github 上有一个 Java 端口的 open-vcdiff 。 它针对 open-vcdiff 进行了测试,但并未在任何地方的生产中使用。

I have a Java port of open-vcdiff on Github. It's tested against open-vcdiff, but it's not used in production anywhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文