Skip to content

Commit 3ad0536

Browse files
authored
Refactor MurmurHash1 to use Endianness utility
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent b0bf32d commit 3ad0536

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

HashifyNet/Algorithms/MurmurHash/MurmurHash1_Implementation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected override IHashValue ComputeHashInternal(ArraySegment<byte> data, Cance
8080

8181
for (var currentOffset = dataOffset; currentOffset < groupEndOffset; currentOffset += 4)
8282
{
83-
hashValue += BitConverter.ToUInt32(dataArray, currentOffset);
83+
hashValue += Endianness.ToUInt32LittleEndian(dataArray, currentOffset);
8484
hashValue *= _m;
8585
hashValue ^= hashValue >> 16;
8686
}
@@ -112,8 +112,8 @@ protected override IHashValue ComputeHashInternal(ArraySegment<byte> data, Cance
112112
hashValue ^= hashValue >> 17;
113113

114114
return new HashValue(
115-
BitConverter.GetBytes(hashValue),
115+
Endianness.GetBytesLittleEndian(hashValue),
116116
32);
117117
}
118118
}
119-
}
119+
}

0 commit comments

Comments
 (0)