Giter Site home page Giter Site logo

endel / fossildelta Goto Github PK

View Code? Open in Web Editor NEW
108.0 8.0 14.0 83 KB

An efficient delta compression algorithm written in C#

Home Page: https://www.fossil-scm.org/index.html/doc/trunk/www/delta_format.wiki

License: Other

C# 99.79% Shell 0.07% Makefile 0.14%
delta compression fossil-scm

fossildelta's Introduction

Delta compression algorithm for C#

Build Status

This is a port from the original C implementation. See references below.

Fossil achieves efficient storage and low-bandwidth synchronization through the use of delta-compression. Instead of storing or transmitting the complete content of an artifact, fossil stores or transmits only the changes relative to a related artifact.

Other implementations:

Installation

NuGet Gallery

FossilDelta is available on the NuGet Gallery.

You can add FossilDelta to your project with the NuGet Package Manager, by using the following command in the Package Manager Console.

PM> Install-Package FossilDelta

Usage

Fossil.Delta.Create(byte[] origin, byte[] target)

Returns the difference between origin and target as a byte array (byte[])

Fossil.Delta.Apply(byte[] origin, byte[] delta)

Apply the delta patch on origin, returning the final value as byte array (byte[]).

Throws an error if it fails to apply the delta (e.g. if it was corrupted).

Fossil.Delta.OutputSize(byte[] delta)

Returns a size of target for this delta.

Throws an error if it can't read the size from delta.

Benchmark

See the inputs used for benchmarking. Run the benchmarks locally using the make benchmark in your commandline.

Results:

       Method |           Mean |        StdErr |         StdDev |         Median |
------------- |--------------- |-------------- |--------------- |--------------- |
 CreateDelta1 |  5,426.4132 ns |   787.5304 ns |  6,201.0206 ns |  4,286.4851 ns |
 CreateDelta2 | 21,837.1107 ns | 1,661.4695 ns | 13,900.8509 ns | 25,942.1491 ns |
 CreateDelta3 | 11,697.2018 ns | 1,213.1634 ns | 12,607.5636 ns |  9,260.4452 ns |
 CreateDelta4 |    253.4085 ns |    25.1048 ns |    214.4952 ns |    252.6454 ns |
 CreateDelta5 |    150.4963 ns |    29.0635 ns |    311.6718 ns |      0.0000 ns |
  ApplyDelta1 |  3,547.0234 ns |   493.4131 ns |  4,357.7065 ns |  3,086.8397 ns |
  ApplyDelta2 | 20,336.7691 ns | 2,488.0257 ns | 27,254.9560 ns |  9,233.5811 ns |
  ApplyDelta3 |  1,441.5354 ns |   209.2071 ns |  1,995.7090 ns |    855.9650 ns |
  ApplyDelta4 |    252.5743 ns |    29.7323 ns |    234.1123 ns |    236.0480 ns |
  ApplyDelta5 |     68.5550 ns |     9.2923 ns |     92.4574 ns |     39.0918 ns |

fossildelta's People

Contributors

endel avatar igor84 avatar israellot 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fossildelta's Issues

Delta compress size is bigger than the size of target byte size when I pass a large byte array

To whom it may concern
I am giving the below byte arrays to the fossil.Delta.Create but at the end final byte array provided by the mentioned function is bigger than the target byte array

Origin byte array (Length = 657)
[00-00-A5-AF-9A-10-F8-D7-B6-1E-0A-5F-F6-1F-98-EF-40-5F-00-00-A4-92-B2-2B-F3-DE-E2-45-2F-6A-B1-CC-9E-89-1F-4E-E5-BE-57-E3-DB-22-DA-2F-C1-9A-C3-00-80-D2-57-4D-88-21-3A-5C-50-D5-B0-22-10-1E-8F-31-50-00-00-64-2C-59-33-54-2F-A4-1C-3C-FD-65-17-87-C4-9C-7E-8E-93-59-02-2A-10-0E-08-AC-9F-9F-00-40-E9-AB-26-44-E8-DD-23-38-26-11-05-28-E1-00-10-38-00-00-83-15-29-5D-CD-60-BA-58-FC-77-52-7F-EF-60-B7-5F-C5-BC-48-FB-C8-DB-FA-13-BE-29-70-00-A0-F4-55-13-22-AC-92-E9-03-42-D2-0F-24-5F-61-E5-03-00-00-E8-4C-1C-DA-5B-DC-4A-5B-F1-F2-B6-7C-FC-51-2F-D1-9A-A4-7D-7F-60-A7-FB-11-36-F1-47-00-50-FA-AA-09-F1-45-25-03-A2-38-45-FD-D1-25-35-04-02-00-00-56-64-06-72-4D-1F-C1-14-7B-38-B4-11-2E-C8-C0-2F-F1-84-AF-41-B8-37-04-9B-9D-E6-2B-00-28-7D-D5-84-9A-52-C2-FE-FA-01-55-FF-EC-EA-90-FC-06-00-C0-DF-D0-BE-E6-82-F4-30-7D-1F-0B-32-52-28-0C-4E-96-47-1E-6B-9F-EB-03-81-47-B8-00-1A-00-94-BE-6A-42-04-7A-FA-81-C4-EF-15-82-30-BE-5E-82-03-00-B0-FD-99-4E-92-D3-EC-54-D1-9B-25-C5-19-44-FE-09-AD-9C-9F-F4-6F-DE-61-3D-3A-EE-07-0F-00-4A-5F-35-21-F8-CD-54-41-4A-32-56-40-8E-10-F8-C0-01-00-88-26-D9-48-6F-FB-C2-F8-9B-2D-98-F0-18-0D-03-77-4A-BE-BD-A7-87-03-77-9F-7B-31-84-08-00-A5-AF-9A-10-36-A1-3E-1F-37-DD-D3-1F-08-1F-76-5F-00-00-18-9E-27-1B-4A-AA-4C-D2-AB-5C-37-95-58-82-F1-D0-ED-94-1B-F8-F3-04-D5-2F-0C-C2-C0-04-80-D2-57-4D-08-B4-95-FC-0F-DC-50-62-10-36-A8-2B-50-00-00-7A-10-44-F7-99-97-1D-54-B2-B5-20-4A-C4-4C-DE-82-8E-31-54-08-4E-57-F6-57-E1-BC-A0-02-40-E9-AB-26-64-D2-BD-DD-57-41-2A-00-28-BC-69-E7-07-00-00-AA-23-92-76-A4-B3-9E-3E-9E-A1-4E-F1-5F-A2-7F-95-BD-0E-1B-FB-CC-01-FB-23-C9-85-70-01-A0-F4-55-13-62-14-F6-18-34-2A-47-07-04-9E-84-0B-0C-00-00-D5-A2-63-4B-E9-5F-90-45-D4-CD-A9-0F-16-91-80-DB-E3-09-4A-7E-EB-4C-03-72-81-26-C8-00-50-FA-AA-09-01-94-1F-EC-39-9A-4F-FE-F1-6A-32-F4-05-00-40-95-CE-98-23-5B-2D-2C-1D-19-DF-8A-B5-E1-97-B4-84-8D-99-A3-BF-11-53-FF-0A-D9-04-6C-00-28-7D-D5-84-60-51-6D-06-25-36-07-00-E9-05-DE-02-05-00-A0-BF-E4-72-0D-39-DC-E2-86-B5-78-F6-D2-0C-94-3C-FB-D8-E5-14-E0-E7-81-7E-46-70-F]
Target Byte Array (Length = 2016)
[Raw Data Length: 2016, Data: 0E-C0-A7-B2-9A-10-F7-F3-42-1F-F4-12-DD-9F-47-12-9D-DF-00-00-74-77-F0-B2-08-E9-A2-A7-6D-FE-B5-32-0C-7D-A4-28-EF-A2-3F-11-E4-EB-EE-D0-80-DB-BE-07-E0-53-59-4D-88-63-94-04-D0-2E-78-15-10-30-5B-36-70-00-00-FE-41-16-44-16-7C-59-CE-5B-4E-A1-19-86-C3-22-1B-92-B9-E1-07-F6-2B-EE-57-27-9D-1F-04-F0-A9-AC-26-94-D6-3D-06-18-A4-92-F2-C7-6F-78-D7-37-00-00-8C-59-A4-18-8E-B2-EB-5A-D4-10-91-56-01-60-BF-2C-B8-C4-6F-F7-58-5A-0C-EC-29-65-30-02-F8-54-56-13-4A-7E-7A-FA-43-B5-78-20-A4-CF-8F-12-0C-00-00-FD-2F-2E-22-A9-40-F7-32-83-E6-67-04-87-D4-EA-0A-26-E8-40-80-AD-D6-08-BA-D3-EC-27-01-7C-2A-AB-09-AD-9E-B2-FE-BD-9F-9A-FC-91-D4-33-F7-0D-00-00-F1-12-93-02-D6-21-91-82-5F-09-E4-09-03-D8-CE-83-CE-2C-01-BE-3B-84-01-3D-22-FD-9B-00-3E-95-D5-84-E2-5D-20-FE-D0-53-D3-05-31-DE-98-04-07-00-00-17-38-ED-C1-72-E1-34-3A-A8-F0-D9-46-D8-0C-1D-87-99-35-07-A0-77-67-7F-02-DD-02-52-00-9F-CA-6A-42-B6-36-38-80-53-64-38-7F-88-FF-DD-7C-03-00-70-5C-C0-3A-71-5A-0E-2C-4E-2C-0E-4F-70-FF-3D-B5-49-83-BD-C1-0F-44-FD-40-32-28-FC-2A-80-4F-65-35-A1-8B-12-F8-3F-5C-9A-08-41-56-D2-41-41-00-00-90-32-6B-92-38-FB-CC-35-BB-F4-83-47-71-28-C7-06-6C-D2-A6-FC-E7-35-C4-1E-1B-82-81-16-C0-A7-B2-9A-50-57-95-C3-DF-F8-CA-CC-9F-29-22-8D-DF-00-00-2C-F5-5F-0B-D4-6C-B9-EF-17-AA-BD-4B-2E-82-5D-84-F6-92-30-EA-53-92-00-70-89-53-C1-0B-E0-53-59-4D-08-AA-18-49-70-AC-6E-F1-CF-9D-84-DB-0F-00-00-0C-DC-55-E1-A7-47-4B-F5-45-24-63-1A-1C-C5-52-A7-79-3D-19-F2-7D-37-E1-A7-C8-CE-1E-06-F0-A9-AC-26-84-63-04-B3-07-3C-36-00-E8-E1-CA-02-18-00-00-86-99-61-62-4A-78-87-45-C9-04-AB-CB-74-A0-51-1F-43-F0-B7-00-21-56-0C-4C-6B-30-30-03-F8-54-56-13-42-F5-47-17-74-FD-7D-0A-C4-C0-0B-F1-1B-00-00-67-9B-6D-FF-34-27-DD-75-2E-06-5A-E2-D0-51-CB-C0-5C-72-A1-81-7F-9C-E8-65-4F-16-A8-01-7C-2A-AB-09-31-19-A6-F2-CD-00-DE-FC-59-AE-C9-04-0E-00-80-FB-2A-3F-1C-6E-89-AE-C6-7D-4F-BB-96-34-58-2B-C8-91-0F-87-41-B4-F2-FF-D0-A4-22-DC-00-3E-95-D5-84-B0-76-01-03-E7-31-77-FF-64-73-26-FB-02-00-80-D3-02-17-64-ED-7E-AA-48-86-4D-9A-4C-F8-13-71-D5-46-60-C7-DF-62-31-81-75-44-FB-71-00-9F-CA-6A-42-F0-D4-52-7C-A9-9F-52-7F-0A-20-B7-80-01-00-A0-8C-FF-C6-44-57-59-7A-BC-53-C1-C4-A1-EC-E9-5E-60-4C-E3-FF-CF-61-CE-BE-34-AC-FC-3A-80-4F-65-35-21-E8-86-8D-41-43-54-50-40-3D-75-57-3F-01-00-A0-5B-B2-8A-99-7F-27-B4-A7-5E-A4-76-77-10-A7-D8-DE-55-E1-F6-27-3B-AB-9F-1D-A7-80-1E-C0-A7-B2-9A-10-41-A7-06-1F-F9-E1-C7-DF-B1-5E-06-60-00-00-E0-76-4F-AD-A3-94-2A-D3-32-AC-2E-55-FA-78-A6-AA-0B-ED-52-F1-13-E3-A2-F0-7D-DC-C0-0F-E0-53-59-4D-08-E8-87-55-30-70-E7-0C-10-4F-BB-C5-4F-00-00-62-57-B4-0A-6D-50-63-6F-43-40-E8-2C-0A-C3-03-34-72-68-D9-FD-99-99-3B-78-92-3E-20-08-F0-A9-AC-26-04-E1-C6-C2-17-47-2A-F6-07-5F-70-FC-37-00-00-8B-4E-64-EC-73-62-0B-6D-08-A8-AB-DE-E0-DE-61-62-C1-87-3D-03-0F-0D-ED-03-BD-D1-2F-04-F8-54-56-13-72-84-A5-0A-0C-5C-4A-01-6C-86-32-FC-13-00-80-94-A2-13-16-9B-69-FB-A8-0D-33-59-4E-75-50-E2-19-E0-21-E4-82-ED-90-EC-99-48-0F-28-02-7C-2A-AB-09-F1-6F-6B-F8-F5-4F-0E-FD-51-7F-7C-05-0E-00-00-9F-52-DB-D5-B6-03-CE-71-59-AD-DB-08-78-F8-E1-00-B2-77-0C-44-E0-DD-FA-52-2A-34-1C-01-3E-95-D5-84-F4-B5-65-02-8F-C9-88-00-49-05-F9-F9-06-00-80-E0-B4-23-E8-71-34-DB-F1-B8-4A-EA-CE-27-2C-E9-42-D6-59-37-5F-C8-44-7C-B4-D0-F4-91-00-9F-CA-6A-42-0E-85-10-7E-51-C0-71-7F-50-5A-CF-81-03-00-40-00-D6-5C-79-57-A3-1B-AC-E9-DF-F6-4E-EF-6D-A1-CD-A4-D4-E0-8F-CA-23-40-AC-FF-FE-4A-80-4F-65-35-21-AE-B7-C0-40-2B-9D-6C-40-18-D9-BD-3E-01-00-E8-46-16-BC-1E-B7-BB-50-04-FA-96-DA-8A-17-21-33-A4-5D-45-01-08-CC-6D-A0-39-E8-7F-26-C0-A7-B2-9A-90-C2-A1-72-DF-13-C8-D7-9F-83-4C-4A-A0-00-00-FC-F4-ED-AB-D8-C3-90-24-F9-01-B8-3F-89-88-85-90-1E-CB-F2-39-E4-78-B3-AF-A4-78-C4-13-E0-53-59-4D-88-84-35-18-90-2A-B3-11-D0-5F-E6-BE-0F-00-00-FE-DE-BA-E7-AE-5F-DC-85-6A-AD-E3-DB-51-44-18-1E-6E-88-20-13-86-96-6A-97-EA-2F-20-0A-F0-A9-AC-26-34-80-EF-F4-77-41-9B-FF-47-AE-89-21-38-00-00-02-9A-22-44-CA-8F-B7-63-B3-BA-6F-C3-7B-E0-9E-89-4F-FD-C4-00-2B-71-07-64-80-1B-30-05-F8-54-56-13-32-B8-96-FD-23-1D-9B-FC-63-58-4D-E4-1B-00-80-7E-C8-C2-10-5C-F0-8D-4A-4E-28-18-83-A5-0F-A4-05-57-A4-E3-7F-0A-D0-EE-D1-FF-0C-A8-02-7C-2A-AB-09-D1-E2-E0-F5-F9-2A-5D-00-42-CE-B1-09-02-00-40-CA-72-04-81-A9-0C-51-2B-A4-30-C3-0F-36-38-5B-9D-B4-0A-BC-3F-74-5A-FA-66-91-F6-5B-01-3E-95-D5-84-10-0C-44-03-43-AF-DE-FE-E8-E4-AD-F9-06-00-A0-E2-40-74-2A-16-FE-F1-DC-7D-6C-16-13-DA-C3-5F-E1-55-E1-99-1F-B9-0D-7F-9B-93-0A-B2-00-9F-CA-6A-42-C4-A1-D9-7D-1D-D6-45-80-C4-60-77-82-03-00-10-0A-36-4E-D7-B6-EF-D0-0E-61-D5-D6-41-18-86-D2-34-ED-AC-4A-90-28-14-40-93-67-00-5B-80-4F-65-35-21-A7-31-10-40-BB-C1-9A-3F-8A-04-45-BE-01-00-C8-B1-18-13-3C-42-DF-DD-52-07-8A-72-64-17-9B-EA-A8-11-28-19-07-1E-23-20-C4-C5-79-2E-C0-A7-B2-9A-10-64-DF-C9-9F-A8-46-17-20-8E-14-74-20-00-00-18-F6-A9-AF-70-5B-3A-29-A6-CD-BD-40-60-87-92-5B-3E-8F-CA-10-4C-55-D1-6F-0C-DD-BD-17-E0-53-59-4D-C8-22-F6-22-F0-C7-F6-E7-CF-80-E5-C9-6F-00-00-28-7B-27-EC-7B-1A-D0-86-08-65-25-5A-1F-3C-3A-C7-6F-38-21-E6-E5-46-55-27-63-BE-1F-0C-F0-A9-AC-26-64-E8-67-F0-E7-9A-BC-03-A8-42-35-14-38-00-00-65-92-FC-15-47-D9-14-1E-38-3B-0F-04-70-21-42-2D-CC-43-A6-FD-B4-65-E3-03-5A-EB-2F-06-F8-54-56-13-82-CE-BA-F3-C3-41-BD-FB-A3-ED-A3-F0-03-00-80-9D-95-2C-01-06-A5-1B-5C-27-18-27-9A-62-CF-E0-12-1B-5B-EF-7B-0A-B2-0C-16-C4-19-28-03-7C-2A-AB-09-89-DB-F6-02-22-58-BE-05-DE-09-F3-FF-09-00-C0-D3-2B-CA-22-55-CD-8C-2D-F8-8E-24-54-79-B9-98-E5-30-87-2A-40-AA-71-FF-44-81-FB-9B-01-3E-95-D5-84-68-06-9C-FC-EA-55-D6-FE-C0-FE-97-FE-02-00-00-34-57-D1-59-76-EE-7C-E3-DD-C7-31-28-3B-84-67-15-E8-0F-CC-9F-87-34-7D-64-74-1B-D2-00-9F-CA-6A-42-82-1F-5E-81-1E-E0-BF-80-8D-52-10-7F-02-00-50-A2-A4-50-08-C3-B6-DA-70-BB-38-81-C7-38-A2-5F-CA-43-8A-E0-0F-77-E3-40-37-18-02-6B-80-4F-65-35-21-F2-38-C8-BE-22-24-9A-3F-13-B9-A6-3F-00-00-F0-F5-69-D3-96-39-18-50-87-3C-6B-D6-4A-0F-D5-2B-E4-A9-33-E4-F7-75-83-E1-9B-28-8D-36-C0-A7-B2-9A-10-30-CB-6A-A0-90-1C-3F-60-78-84-EA-1F-00-00-84-59-86-A8-84-60-6C-62-8E-59-D1-AE-F3-92-E6-31-05-0D-D4-2B-5C-93-8B-0F-8E-FD-BF-1B-E0-53-59-4D-88-75-07-C7-0F-56-7C-E6-8F-72-A3-FF-2F-00-00-54-4C-69-56-7D-DA-7A-7D-14-1F-9E-30-2D-C2-0D-93-87-08-A7-11-D2-BF-FC-D7-A7-1D-21-0E-F0-A9-AC-26-44-40-F2-10-E8-F4-0B-12-48-90-DC-F6-07-00-00-F4-F3-8E-23-50-09-2D-1A-C9-4D-F3-28-9E-65-81-80-3F-F1-CB-FE-CC-EE-05-4C-F3-1C-10]
Result Byte Array After delta compression  (length = 2029):  
[56-57-0A-56-57-3A-0E-C0-A7-B2-9A-10-F7-F3-42-1F-F4-12-DD-9F-47-12-9D-DF-00-00-74-77-F0-B2-08-E9-A2-A7-6D-FE-B5-32-0C-7D-A4-28-EF-A2-3F-11-E4-EB-EE-D0-80-DB-BE-07-E0-53-59-4D-88-63-94-04-D0-2E-78-15-10-30-5B-36-70-00-00-FE-41-16-44-16-7C-59-CE-5B-4E-A1-19-86-C3-22-1B-92-B9-E1-07-F6-2B-EE-57-27-9D-1F-04-F0-A9-AC-26-94-D6-3D-06-18-A4-92-F2-C7-6F-78-D7-37-00-00-8C-59-A4-18-8E-B2-EB-5A-D4-10-91-56-01-60-BF-2C-B8-C4-6F-F7-58-5A-0C-EC-29-65-30-02-F8-54-56-13-4A-7E-7A-FA-43-B5-78-20-A4-CF-8F-12-0C-00-00-FD-2F-2E-22-A9-40-F7-32-83-E6-67-04-87-D4-EA-0A-26-E8-40-80-AD-D6-08-BA-D3-EC-27-01-7C-2A-AB-09-AD-9E-B2-FE-BD-9F-9A-FC-91-D4-33-F7-0D-00-00-F1-12-93-02-D6-21-91-82-5F-09-E4-09-03-D8-CE-83-CE-2C-01-BE-3B-84-01-3D-22-FD-9B-00-3E-95-D5-84-E2-5D-20-FE-D0-53-D3-05-31-DE-98-04-07-00-00-17-38-ED-C1-72-E1-34-3A-A8-F0-D9-46-D8-0C-1D-87-99-35-07-A0-77-67-7F-02-DD-02-52-00-9F-CA-6A-42-B6-36-38-80-53-64-38-7F-88-FF-DD-7C-03-00-70-5C-C0-3A-71-5A-0E-2C-4E-2C-0E-4F-70-FF-3D-B5-49-83-BD-C1-0F-44-FD-40-32-28-FC-2A-80-4F-65-35-A1-8B-12-F8-3F-5C-9A-08-41-56-D2-41-41-00-00-90-32-6B-92-38-FB-CC-35-BB-F4-83-47-71-28-C7-06-6C-D2-A6-FC-E7-35-C4-1E-1B-82-81-16-C0-A7-B2-9A-50-57-95-C3-DF-F8-CA-CC-9F-29-22-8D-DF-00-00-2C-F5-5F-0B-D4-6C-B9-EF-17-AA-BD-4B-2E-82-5D-84-F6-92-30-EA-53-92-00-70-89-53-C1-0B-E0-53-59-4D-08-AA-18-49-70-AC-6E-F1-CF-9D-84-DB-0F-00-00-0C-DC-55-E1-A7-47-4B-F5-45-24-63-1A-1C-C5-52-A7-79-3D-19-F2-7D-37-E1-A7-C8-CE-1E-06-F0-A9-AC-26-84-63-04-B3-07-3C-36-00-E8-E1-CA-02-18-00-00-86-99-61-62-4A-78-87-45-C9-04-AB-CB-74-A0-51-1F-43-F0-B7-00-21-56-0C-4C-6B-30-30-03-F8-54-56-13-42-F5-47-17-74-FD-7D-0A-C4-C0-0B-F1-1B-00-00-67-9B-6D-FF-34-27-DD-75-2E-06-5A-E2-D0-51-CB-C0-5C-72-A1-81-7F-9C-E8-65-4F-16-A8-01-7C-2A-AB-09-31-19-A6-F2-CD-00-DE-FC-59-AE-C9-04-0E-00-80-FB-2A-3F-1C-6E-89-AE-C6-7D-4F-BB-96-34-58-2B-C8-91-0F-87-41-B4-F2-FF-D0-A4-22-DC-00-3E-95-D5-84-B0-76-01-03-E7-31-77-FF-64-73-26-FB-02-00-80-D3-02-17-64-ED-7E-AA-48-86-4D-9A-4C-F8-13-71-D5-46-60-C7-DF-62-31-81-75-44-FB-71-00-9F-CA-6A-42-F0-D4-52-7C-A9-9F-52-7F-0A-20-B7-80-01-00-A0-8C-FF-C6-44-57-59-7A-BC-53-C1-C4-A1-EC-E9-5E-60-4C-E3-FF-CF-61-CE-BE-34-AC-FC-3A-80-4F-65-35-21-E8-86-8D-41-43-54-50-40-3D-75-57-3F-01-00-A0-5B-B2-8A-99-7F-27-B4-A7-5E-A4-76-77-10-A7-D8-DE-55-E1-F6-27-3B-AB-9F-1D-A7-80-1E-C0-A7-B2-9A-10-41-A7-06-1F-F9-E1-C7-DF-B1-5E-06-60-00-00-E0-76-4F-AD-A3-94-2A-D3-32-AC-2E-55-FA-78-A6-AA-0B-ED-52-F1-13-E3-A2-F0-7D-DC-C0-0F-E0-53-59-4D-08-E8-87-55-30-70-E7-0C-10-4F-BB-C5-4F-00-00-62-57-B4-0A-6D-50-63-6F-43-40-E8-2C-0A-C3-03-34-72-68-D9-FD-99-99-3B-78-92-3E-20-08-F0-A9-AC-26-04-E1-C6-C2-17-47-2A-F6-07-5F-70-FC-37-00-00-8B-4E-64-EC-73-62-0B-6D-08-A8-AB-DE-E0-DE-61-62-C1-87-3D-03-0F-0D-ED-03-BD-D1-2F-04-F8-54-56-13-72-84-A5-0A-0C-5C-4A-01-6C-86-32-FC-13-00-80-94-A2-13-16-9B-69-FB-A8-0D-33-59-4E-75-50-E2-19-E0-21-E4-82-ED-90-EC-99-48-0F-28-02-7C-2A-AB-09-F1-6F-6B-F8-F5-4F-0E-FD-51-7F-7C-05-0E-00-00-9F-52-DB-D5-B6-03-CE-71-59-AD-DB-08-78-F8-E1-00-B2-77-0C-44-E0-DD-FA-52-2A-34-1C-01-3E-95-D5-84-F4-B5-65-02-8F-C9-88-00-49-05-F9-F9-06-00-80-E0-B4-23-E8-71-34-DB-F1-B8-4A-EA-CE-27-2C-E9-42-D6-59-37-5F-C8-44-7C-B4-D0-F4-91-00-9F-CA-6A-42-0E-85-10-7E-51-C0-71-7F-50-5A-CF-81-03-00-40-00-D6-5C-79-57-A3-1B-AC-E9-DF-F6-4E-EF-6D-A1-CD-A4-D4-E0-8F-CA-23-40-AC-FF-FE-4A-80-4F-65-35-21-AE-B7-C0-40-2B-9D-6C-40-18-D9-BD-3E-01-00-E8-46-16-BC-1E-B7-BB-50-04-FA-96-DA-8A-17-21-33-A4-5D-45-01-08-CC-6D-A0-39-E8-7F-26-C0-A7-B2-9A-90-C2-A1-72-DF-13-C8-D7-9F-83-4C-4A-A0-00-00-FC-F4-ED-AB-D8-C3-90-24-F9-01-B8-3F-89-88-85-90-1E-CB-F2-39-E4-78-B3-AF-A4-78-C4-13-E0-53-59-4D-88-84-35-18-90-2A-B3-11-D0-5F-E6-BE-0F-00-00-FE-DE-BA-E7-AE-5F-DC-85-6A-AD-E3-DB-51-44-18-1E-6E-88-20-13-86-96-6A-97-EA-2F-20-0A-F0-A9-AC-26-34-80-EF-F4-77-41-9B-FF-47-AE-89-21-38-00-00-02-9A-22-44-CA-8F-B7-63-B3-BA-6F-C3-7B-E0-9E-89-4F-FD-C4-00-2B-71-07-64-80-1B-30-05-F8-54-56-13-32-B8-96-FD-23-1D-9B-FC-63-58-4D-E4-1B-00-80-7E-C8-C2-10-5C-F0-8D-4A-4E-28-18-83-A5-0F-A4-05-57-A4-E3-7F-0A-D0-EE-D1-FF-0C-A8-02-7C-2A-AB-09-D1-E2-E0-F5-F9-2A-5D-00-42-CE-B1-09-02-00-40-CA-72-04-81-A9-0C-51-2B-A4-30-C3-0F-36-38-5B-9D-B4-0A-BC-3F-74-5A-FA-66-91-F6-5B-01-3E-95-D5-84-10-0C-44-03-43-AF-DE-FE-E8-E4-AD-F9-06-00-A0-E2-40-74-2A-16-FE-F1-DC-7D-6C-16-13-DA-C3-5F-E1-55-E1-99-1F-B9-0D-7F-9B-93-0A-B2-00-9F-CA-6A-42-C4-A1-D9-7D-1D-D6-45-80-C4-60-77-82-03-00-10-0A-36-4E-D7-B6-EF-D0-0E-61-D5-D6-41-18-86-D2-34-ED-AC-4A-90-28-14-40-93-67-00-5B-80-4F-65-35-21-A7-31-10-40-BB-C1-9A-3F-8A-04-45-BE-01-00-C8-B1-18-13-3C-42-DF-DD-52-07-8A-72-64-17-9B-EA-A8-11-28-19-07-1E-23-20-C4-C5-79-2E-C0-A7-B2-9A-10-64-DF-C9-9F-A8-46-17-20-8E-14-74-20-00-00-18-F6-A9-AF-70-5B-3A-29-A6-CD-BD-40-60-87-92-5B-3E-8F-CA-10-4C-55-D1-6F-0C-DD-BD-17-E0-53-59-4D-C8-22-F6-22-F0-C7-F6-E7-CF-80-E5-C9-6F-00-00-28-7B-27-EC-7B-1A-D0-86-08-65-25-5A-1F-3C-3A-C7-6F-38-21-E6-E5-46-55-27-63-BE-1F-0C-F0-A9-AC-26-64-E8-67-F0-E7-9A-BC-03-A8-42-35-14-38-00-00-65-92-FC-15-47-D9-14-1E-38-3B-0F-04-70-21-42-2D-CC-43-A6-FD-B4-65-E3-03-5A-EB-2F-06-F8-54-56-13-82-CE-BA-F3-C3-41-BD-FB-A3-ED-A3-F0-03-00-80-9D-95-2C-01-06-A5-1B-5C-27-18-27-9A-62-CF-E0-12-1B-5B-EF-7B-0A-B2-0C-16-C4-19-28-03-7C-2A-AB-09-89-DB-F6-02-22-58-BE-05-DE-09-F3-FF-09-00-C0-D3-2B-CA-22-55-CD-8C-2D-F8-8E-24-54-79-B9-98-E5-30-87-2A-40-AA-71-FF-44-81-FB-9B-01-3E-95-D5-84-68-06-9C-FC-EA-55-D6-FE-C0-FE-97-FE-02-00-00-34-57-D1-59-76-EE-7C-E3-DD-C7-31-28-3B-84-67-15-E8-0F-CC-9F-87-34-7D-64-74-1B-D2-00-9F-CA-6A-42-82-1F-5E-81-1E-E0-BF-80-8D-52-10-7F-02-00-50-A2-A4-50-08-C3-B6-DA-70-BB-38-81-C7-38-A2-5F-CA-43-8A-E0-0F-77-E3-40-37-18-02-6B-80-4F-65-35-21-F2-38-C8-BE-22-24-9A-3F-13-B9-A6-3F-00-00-F0-F5-69-D3-96-39-18-50-87-3C-6B-D6-4A-0F-D5-2B-E4-A9-33-E4-F7-75-83-E1-9B-28-8D-36-C0-A7-B2-9A-10-30-CB-6A-A0-90-1C-3F-60-78-84-EA-1F-00-00-84-59-86-A8-84-60-6C-62-8E-59-D1-AE-F3-92-E6-31-05-0D-D4-2B-5C-93-8B-0F-8E-FD-BF-1B-E0-53-59-4D-88-75-07-C7-0F-56-7C-E6-8F-72-A3-FF-2F-00-00-54-4C-69-56-7D-DA-7A-7D-14-1F-9E-30-2D-C2-0D-93-87-08-A7-11-D2-BF-FC-D7-A7-1D-21-0E-F0-A9-AC-26-44-40-F2-10-E8-F4-0B-12-48-90-DC-F6-07-00-00-F4-F3-8E-23-50-09-2D-1A-C9-4D-F3-28-9E-65-81-80-3F-F1-CB-FE-CC-EE-05-4C-F3-1C-10-33-75-4C-7E-4]

Sincerely yours!

Missing brace in for loop?

First just wanna say THANKS! Thanks for writing an API that just works. I expected to have to write only 2 lines of code from a usage stand point to create and apply a delta, and that's exactly what this API offers. Very nice usage interface. A breeze from all the over-engineered crap you usually see out there.

One thing I found is after downloading the source, there's a missing open brace for the for loop in Create(..)?

for (i = lenSrc - lenSrc % NHASH - NHASH; i >= 0; i -= NHASH)

Other than that it works great!

Test on data folder 2 not passing

It seems the commit 264ea17 "performance tweak" broke the test on input data in folder "2". The delta that is created no longer corresponds to the delta that was generated by the original tool. On the other hand if that new delta is applied to original data, target data is generated correctly.

I can make a pull request with updated delta file in folder 2 if you agree that is ok to do. This will mean generate-deltas.sh script can't be used any more to regenerate delta data.

Identifying identical files

Thank you for the great work you put into this port - it seems to run very efficiently.

I have been reading over the format, and am just wondering if you can confirm my understanding:

  • If the origin and target are the same then the byte stream will always start with [Size]\n[Size]@0,. Meaning that the full set of bytes is a copy.

Is checking for this condition the best approach to identify files (post diff) that are identical?
Edit: Is there the possibility of flagging this condition to optionally return an empty byte array?

My scenario is where I have an archive of file diffs, and I want to be able to simply write a zero byte file so that I can bypass Applying them altogether later-on and simply perform a straight copy.

Thanks.

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.