anchor.diff:  procedure TTestRandomHash.SetUp;
   begin
     inherited;
  +  FMurmurHash3_x86_32 := THashFactory.THash32.CreateMurmurHash3_x86_32();
  +  FHashAlg[0] := THashFactory.TCrypto.CreateSHA2_256();
  +  FHashAlg[1] := THashFactory.TCrypto.CreateSHA2_384();
  +  FHashAlg[2] := THashFactory.TCrypto.CreateSHA2_512();
  +  FHashAlg[3] := THashFactory.TCrypto.CreateSHA3_256();
  +  FHashAlg[4] := THashFactory.TCrypto.CreateSHA3_384();
  +  FHashAlg[5] := THashFactory.TCrypto.CreateSHA3_512();
  +  FHashAlg[6] := THashFactory.TCrypto.CreateRIPEMD160();
  +  FHashAlg[7] := THashFactory.TCrypto.CreateRIPEMD256();
  +  FHashAlg[8] := THashFactory.TCrypto.CreateRIPEMD320();
  +  FHashAlg[9] := THashFactory.TCrypto.CreateBlake2B_512();
  +  FHashAlg[10] := THashFactory.TCrypto.CreateBlake2S_256();
  +  FHashAlg[11] := THashFactory.TCrypto.CreateTiger2_5_192();
  +  FHashAlg[12] := THashFactory.TCrypto.CreateSnefru_8_256();
  +  FHashAlg[13] := THashFactory.TCrypto.CreateGrindahl512();
  +  FHashAlg[14] := THashFactory.TCrypto.CreateHaval_5_256();
  +  FHashAlg[15] := THashFactory.TCrypto.CreateMD5();
  +  FHashAlg[16] := THashFactory.TCrypto.CreateRadioGatun32();
  +  FHashAlg[17] := THashFactory.TCrypto.CreateWhirlPool();
   end;
   
   procedure TTestRandomHash.TearDown;
   begin
  +  FMurmurHash3_x86_32 := Nil;
  +  FHashAlg[1] := nil;
  +  FHashAlg[2] := nil;
  +  FHashAlg[3] := nil;
  +  FHashAlg[4] := nil;
  +  FHashAlg[5] := nil;
  +  FHashAlg[6] := nil;
  +  FHashAlg[7] := nil;
  +  FHashAlg[8] := nil;
  +  FHashAlg[9] := nil;
  +  FHashAlg[10] := nil;
  +  FHashAlg[11] := nil;
  +  FHashAlg[12] := nil;
  +  FHashAlg[13] := nil;
  +  FHashAlg[14] := nil;
  +  FHashAlg[15] := nil;
  +  FHashAlg[16] := nil;
  +  FHashAlg[17] := nil;
     inherited;
   end;
   
   procedure TTestRandomHash.TestEmpty;
   var
  -  LDigest, LHash : TBytes;
  -  LHashHex : AnsiString;
  +  LDigest, LHash: TBytes;
  +  LHashHex: AnsiString;
   begin
     LDigest := TEncoding.ASCII.GetBytes('');
     LHash := TRandomHash.Compute(LDigest);
  
positive.code: interface
  
  uses
    Classes, SysUtils, {$IFDEF FPC}fpcunit,testregistry,{$ELSE}TestFramework,{$ENDIF FPC}
    URandomHash;
  
  type
    { TTestRandomHash }
  
    TTestRandomHash = class(TTestCase)
      protected
        procedure SetUp; override;
        procedure TearDown; override;
      published
        procedure TestEmpty;
        procedure TestQuickBrownFox;
    end;
  
  implementation
  
negative.code: 
  procedure TTestRandomHash.TestQuickBrownFox;
  var
    LDigest, LHash: TBytes;
    LHashHex: AnsiString;
  begin
    LDigest := TEncoding.ASCII.GetBytes
      ('The quick brown fox jumps over the lazy dog');
    LHash := TRandomHash.Compute(LDigest);
    LHashHex := Buffer2Hex(LHash);
    // TODO: need to tweak RandomHash with Polyminer to establish correctness
  end;
  
  procedure TTestRandomHash.TestRandomHashSequence;
  var
    HeaderBytes, InputHeaderBytes, HashResult: TBytes;
    HashResultStr, ExpectedStr: string;
    i, k, tlen: Int32;
  begin
    InputHeaderBytes := TConverters.ConvertHexStringToBytes(InputHeader);
    for i := 1 to 16 do
    begin
      tlen := InputLength[i];
      System.SetLength(HeaderBytes, tlen);
  
      for k := 0 to 17 do
      begin
        ExpectedStr := UpperCase(ExpectedValues[i][k + 1]);
        System.Move(InputHeaderBytes[0], HeaderBytes[0], tlen);
  
        HashResult := FHashAlg[k].ComputeBytes(HeaderBytes).GetBytes();
        HashResultStr := TConverters.ConvertBytesToHexString(HashResult, False);
  
        CheckEquals(ExpectedStr, HashResultStr, Format('Expected %s but got %s.',
          [ExpectedStr, HashResultStr]));
      end;
  
      // murmur3 test
      ExpectedStr := UpperCase(ExpectedValues[i][19]);
      System.Move(InputHeaderBytes[0], HeaderBytes[0], tlen);
  
      // HashResult := FMurmurHash3_x86_32.ComputeBytes(HeaderBytes).GetBytes();
      // HashResultStr := TConverters.ConvertBytesToHexString(HashResult, False);
      HashResultStr := FMurmurHash3_x86_32.ComputeBytes(HeaderBytes).ToString();
  
      CheckEquals(ExpectedStr, HashResultStr, Format('Expected %s but got %s.',
        [ExpectedStr, HashResultStr]));
  
    end
  end;
  
  initialization
  
  {$IFDEF FPC}
    RegisterTest(TTestRandomHash);
  