OctopusDeploy / Octodiff

| Public | 100% C# implementation of remote delta compression based on the rsync algorithm
Other
24 stars 87 forks source link

Adler32RollingChecksumV2 seems to give bad results #32

Open Spavid04 opened 2 years ago

Spavid04 commented 2 years ago

Description

When using the V2 rolling checksum algorithm, files that are identical or very slightly different result in huge deltas: the whole new file gets added as the delta.

Environment

I had to make a small code change so the command line app would use the V2 algorithm by default:

diff --git a/source/Octodiff/Core/SupportedAlgorithms.cs b/source/Octodiff/Core/SupportedAlgorithms.cs
index 2cc2aa5..5552f13 100644
--- a/source/Octodiff/Core/SupportedAlgorithms.cs
+++ b/source/Octodiff/Core/SupportedAlgorithms.cs
@@ -52,7 +52,7 @@ namespace Octodiff.Core

         public virtual IRollingChecksum Default()
         {
-            return Adler32Rolling();
+            return Adler32Rolling(true);
         }

         public virtual IRollingChecksum Create(string algorithm)

Steps to reproduce

Other notes

The V1 version of the algorithm does produce expectedly small delta files.