Ed2k URI scheme: Difference between revisions

Content deleted Content added
Sorry, some of this does not meet the necessary style to be included in an article...
eD2k hash algorithm: Formatting and content update along the lines of the IP edit I've previously reverted.
Line 24:
== eD2k hash algorithm ==
 
The eD2k hash function is a [[hash list|root hash]] of a list of [[MD4]] [[hash function|hashes]],. andIt gives a '''different''' result than simplya simple usage of the MD4: algorithm.
 
The file data is divided into full ''chunks'' of 9500 KiB (9728000 bytes) plus a remainder chunk, and a separate '''128-bit MD4 checksum''' is computed for each. If the file length is an exactgreater multiple ofthan 9500 KiB, the(which remaindermeans zerothat sizethere is more than one chunk), the eD2k hash is stillcomputed usedby atconcatenating the endchunks' ofMD4 checksums in order and hashing the result again using MD4. Otherwise, the MD4 hash listof the only chunk of the file is used with no further modifications.<ref>emule source, method <code>CKnownFile::CreateFromFile</code>.</ref>
The eD2k hash is computed by concatenating the chunks' MD4 checksums in order and hashing the result using MD4. Although, if the file is composed of a single non-full chunk, its MD4 hash is used with no further modifications.<ref>emule source, method <code>CKnownFile::CreateFromFile</code>.</ref>
 
This method of hashing allows the recipient to verify that a hash list corresponds to thean original eD2k file hash, without the need to actually have the datafile present on blocksdisk.
 
In the past, there has been some ambiguity for files whose size is a multiple of the chunk size (9500 KiB). Old versions of some eD2k hash tools computed file hashes with an additional 0-byte chunk at the end. This is because an ambiguity of the therm ''reminder chunk'' which can be interpreted as either ''the last chunk'' or a ''non-full chunk at the end''. Following the latter interpretation, some implementations added a zero byte chunk in case the last chunk of a file was a complete one. This practice is discouraged however and the first interpretation is used as a standard nowadays to prevent some files from having different hashes depending on the algorithm implementation used to calculate their hash.<ref>http://mldonkey.sourceforge.net/Ed2k-hash</ref>
http://mldonkey.sourceforge.net/Ed2k-hash 1 January 2006, at 01:01
'''There's some ambiguity for files whose size is a multiple of chunk size; Old versions of the ed2k_hash tool computed file hashes with an additionnal 0-byte chunk at the end. That was fixed in recent versions of the tool.'''
 
== Server links ==