monmohan / xferspdy Goto Github PK
View Code? Open in Web Editor NEWXferspdy provides binary diff and patch library in golang. [Mentioned in Awesome Go, https://github.com/avelino/awesome-go]
License: BSD 3-Clause "New" or "Revised" License
Xferspdy provides binary diff and patch library in golang. [Mentioned in Awesome Go, https://github.com/avelino/awesome-go]
License: BSD 3-Clause "New" or "Revised" License
I'm curious, how does this compared to bsdiff for instance? https://github.com/kr/binarydist
Thanks for this library, it looks nicely written!
The repository took 8 minutes for me to fetch on a reasonably fast connection, I assume it's due to the large examples dir?
Thanks for the effort, but it looks that it doesn't work... At least not optimally. Here's my setup:
I have two binary files (DLLs), which have the exact same size (about 40M), and which differ very slightly. Here's the screenshot from BeyondCompare:
As you can see, the files differ only in very few bytes.
But when I've did the following (example from the documentation):
//Create fingerprint of a file
fingerprint := NewFingerprint("/path/foo_v1.binary", 1024)
//Say the file was updated
//Lets generate the diff
diff := NewDiff("/path/foo_v2.binary", *fingerprint)
I've found out that the resulting diff
has more than 725,000
blocks (Block
). Serialized in JSON the diff is about 9M. I've also tried with a smaller block size (64
), and ended up with diff of 150M in JSON.
Sadly I cannot share the actual DLLs (company secret), but I believe that you can reproduce by using any DLL with a similar size, make a copy with few bytes changed here and there, and try.
Hi,
First of all thank you for the great tool.
I've just tested it but got the error.
Possibly it's related to recursion in the code.
The command:
/home/bin/diff -fingerprint first_root.hdd.fingerprint -file root.hdd
The error:
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
runtime stack:
runtime.throw(0x51f188, 0xe)
/usr/lib/golang/src/runtime/panic.go:566 +0x95
runtime.newstack()
/usr/lib/golang/src/runtime/stack.go:1061 +0x416
runtime.morestack()
/usr/lib/golang/src/runtime/asm_amd64.s:366 +0x7f
goroutine 1 [running]:
crypto/sha256.block(0xc4885304f0, 0xc46e2e01bf, 0x800, 0x841)
/usr/lib/golang/src/crypto/sha256/sha256block_amd64.s:561 fp=0xc488530450 sp=0xc488530448
crypto/sha256.(*digest).Write(0xc4885304f0, 0xc46e2e01bf, 0x800, 0x841, 0x4ae844, 0xc4547bcc10, 0xc46e2ec760)
/usr/lib/golang/src/crypto/sha256/sha256.go:119 +0x120 fp=0xc488530498 sp=0xc488530450
crypto/sha256.Sum256(0xc46e2e01bf, 0x800, 0x841, 0x0, 0x0, 0x0, 0x0)
/usr/lib/golang/src/crypto/sha256/sha256.go:180 +0xca fp=0xc488530578 sp=0xc488530498
github.com/monmohan/xferspdy.processRolling(0x59d4e0, 0xc4547bcc10, 0xc457c05c00, 0x7d87be, 0x8c700000, 0x855eb48000000800, 0xc420018d20, 0xc455801120, 0x8, 0xc4a852fb10)
/usr/src/github.com/monmohan/xferspdy/diff.go:92 +0x856 fp=0xc4885307d0 sp=0xc488530578```
Hello,
You can use it on tcp connections.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.