anchor.diff:  enable_dht(AppConfig) ->
       [{dht, true}|AppConfig].
   
  +
  +%% Returns true, if files are equal.
  +compare_file_contents(Fn1, Fn2) ->
  +    {ok, Fd1} = file:open(Fn1, [binary, read]),
  +    {ok, Fd2} = file:open(Fn2, [binary, read]),
  +    IsEqual = compare_file_contents_1(Fd1, Fd2, 0, 100000),
  +    file:close(Fd1),
  +    file:close(Fd2),
  +    IsEqual.
  +
  +compare_file_contents_1(Fd1, Fd2, Offset, ChunkSize) ->
  +    case {file:pread(Fd1, Offset, ChunkSize),
  +          file:pread(Fd2, Offset, ChunkSize)} of
  +        {eof, eof} -> true;
  +        {{ok, X}, {ok, X}} -> compare_file_contents_1(Fd1, Fd2, Offset+ChunkSize, ChunkSize);
  +        {{ok, _}, {ok, _}} -> false
  +    end.
  
positive.code:     %% Len :: 1 .. 16#FFFF.
      Len  = random:uniform(16#FFFF),
      From = random:uniform(TotalSize - Len),
      file:pwrite(Fd, From, crypto:rand_bytes(Len)).
  
  
  
negative.code: 
      ensure_random_file(Fn),
      ensure_broken_file(Fn, BrokenFn),
      ct:pal("Checking, that a broken version is different... "),
      [error(files_are_equal) || compare_file_contents(Fn, BrokenFn)],
      ensure_random_dir(Dir),
  
      ensure_torrent_file(Fn,  HTTPTorrentFn, "http://localhost:6969/announce"),
  