浏览代码

RandomHash: undo mumur3 workaround due to HashLib4Pascal fix

Herman Schoenfeld 7 年之前
父节点
当前提交
cb89331f6e
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. 2 6
      src/core/URandomHash.pas

+ 2 - 6
src/core/URandomHash.pas

@@ -694,12 +694,8 @@ end;
 
 
 function TRandomHashFast.Checksum(const AInput: TBytes; AOffset, ALength: Integer): UInt32;
 function TRandomHashFast.Checksum(const AInput: TBytes; AOffset, ALength: Integer): UInt32;
 begin
 begin
-   if AOffset = 0 then
-     FMurmurHash3_x86_32.TransformBytes(AInput, AOffset, ALength)
-   else
-     //TODO: Fix MurMur3 implementation in HashLib4Pascal to support non-zero offset
-     FMurmurHash3_x86_32.TransformBytes(TArrayTool<Byte>.Copy(AInput, AOffset, ALength), 0, ALength);
-   Result := FMurmurHash3_x86_32.TransformFinal.GetUInt32();
+  FMurmurHash3_x86_32.TransformBytes(AInput, AOffset, ALength);
+  Result := FMurmurHash3_x86_32.TransformFinal.GetUInt32();
 end;
 end;
 
 
 function TRandomHashFast.Checksum(const AInput : TArray<TBytes>): UInt32;
 function TRandomHashFast.Checksum(const AInput : TArray<TBytes>): UInt32;