Skip to content

Commit

Permalink
Fix for Issue #23 (#60)
Browse files Browse the repository at this point in the history
* Resove computeQuickXorHash generates a different hash when files are > 64Kb
  • Loading branch information
Robert Foster authored and abraunegg committed Jul 10, 2018
1 parent c0d2874 commit f3f216c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qxor.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import std.algorithm;
import std.digest.digest;

// implementation of the QuickXorHash algorithm in D
// https://github.com/OneDrive/onedrive-api-docs/blob/master/snippets/quickxorhash.md
// https://github.com/OneDrive/onedrive-api-docs/blob/live/docs/code-snippets/quickxorhash.md
struct QuickXor
{
private immutable int widthInBits = 160;
Expand Down Expand Up @@ -32,9 +32,9 @@ struct QuickXor
} else {
int index1 = vectorArrayIndex;
int index2 = isLastCell ? 0 : (vectorArrayIndex + 1);
byte low = cast(byte) (bitsInVectorCell - vectorOffset);
ubyte low = cast(ubyte) (bitsInVectorCell - vectorOffset);

byte xoredByte = 0;
ubyte xoredByte = 0;
for (size_t j = i; j < array.length; j += widthInBits) {
xoredByte ^= array[j];
}
Expand Down

0 comments on commit f3f216c

Please sign in to comment.