Developers.Hash.Sample.HashData

From Shareaza Wiki
Revision as of 20:09, 20 June 2009 by Kevogod (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The HashData function

I've written a function that hashes data all the different ways Shareaza can. I wrote it and got it working in the Shareaza 2.0 code, and then updated it to work with camper's new hashing code.

Shareaza 2.0 camper's new code

The objects that compute the hashes are the same. They are:

  • CMD4
  • CMD5
  • CSHA
  • CTigerTree
  • CED2K

The places that store the hash values are not the same.

||Object|Value Size|Value (2.0)|Size (2.0)|Value (camper)|Size (camper)||CMD4|16 bytes|MD4|sizeof(MD4)|CMD4::MD4Digest|sizeof(CMD4::MD4Digest)||CMD5|16 bytes|MD5|sizeof(MD5)|Hashes::Md5Hash|Hashes::Md5Hash::byteCount||CSHA|20 bytes|SHA1|sizeof(SHA1)|Hashes::Sha1Hash|Hashes::Sha1Hash::byteCount||CTigerTree|24 bytes|TIGEROOT|sizeof(TIGEROOT)|Hashes::TigerHash|Hashes::TigerHash::byteCount||CED2K|16 bytes|MD4|sizeof(MD4)|Hashes::Ed2kHash|Hashes::Ed2kHash::byteCount||

The results of each function are pasted on the 2 pages above. Shareaza 2.0 produces all 0s for no data for tiger and donkey, while camper's new code produces hash data. The MD4 and donkey hashes are the same.