Developers.Hash.Formats: Difference between revisions

From Shareaza Wiki
Jump to navigation Jump to search
(Importing page from Tikiwiki)
 
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
Instead of trying to produce every possibility, show the possiblites that camper's code supports, which are the only ones you would actually want, anyway.
Instead of trying to produce every possibility, show the possiblites that camper's code supports, which are the only ones you would actually want, anyway.


<source lang="c">
<!--source lang="c"--><pre>
CString md5string      = md5value.toString();      //        "5d41402abc4b2a76b9719d911017c592"
CString md5string      = md5value.toString();      //        "5d41402abc4b2a76b9719d911017c592"
CString md5shorturn    = md5value.toShortUrn();    //    "md5:5d41402abc4b2a76b9719d911017c592"
CString md5shorturn    = md5value.toShortUrn();    //    "md5:5d41402abc4b2a76b9719d911017c592"
Line 18: Line 18:
CString donkeyshorturn = donkeyvalue.toShortUrn(); //        "ed2k:866437cb7a794bce2b727acc0362ee27"
CString donkeyshorturn = donkeyvalue.toShortUrn(); //        "ed2k:866437cb7a794bce2b727acc0362ee27"
CString donkeyurn      = donkeyvalue.toUrn();      // "urn:ed2khash:866437cb7a794bce2b727acc0362ee27"
CString donkeyurn      = donkeyvalue.toUrn();      // "urn:ed2khash:866437cb7a794bce2b727acc0362ee27"
</source>
</pre><!--/source-->


'''MD5''' is base 16 lowercase, with headers '''md5:''' and '''urn:md5:'''
'''MD5''' is base 16 lowercase, with headers '''md5:''' and '''urn:md5:'''<br/>
'''SHA1''' is base 32 uppercase, with headers '''sha1:''' and '''urn:sha1:'''
'''SHA1''' is base 32 uppercase, with headers '''sha1:''' and '''urn:sha1:'''<br/>
'''TigerTree''' is base 32 uppercase, with headers '''tree:tiger/:''' and '''urn:tree:tiger/:'''
'''TigerTree''' is base 32 uppercase, with headers '''tree:tiger/:''' and '''urn:tree:tiger/:'''<br/>
'''eDonkey2000''' is base 16 lowercase, with headers '''ed2k:''' and '''urn:ed2khash:'''
'''eDonkey2000''' is base 16 lowercase, with headers '''ed2k:''' and '''urn:ed2khash:'''

Latest revision as of 08:57, 1 May 2017

Hash text and URI formats

Instead of trying to produce every possibility, show the possiblites that camper's code supports, which are the only ones you would actually want, anyway.

CString md5string      = md5value.toString();      //         "5d41402abc4b2a76b9719d911017c592"
CString md5shorturn    = md5value.toShortUrn();    //     "md5:5d41402abc4b2a76b9719d911017c592"
CString md5urn         = md5value.toUrn();         // "urn:md5:5d41402abc4b2a76b9719d911017c592"

CString sha1string     = sha1value.toString();     //          "VL2MMHO4YXUKFWV63YHTWSBM3GXKSQ2N"
CString sha1shorturn   = sha1value.toShortUrn();   //     "sha1:VL2MMHO4YXUKFWV63YHTWSBM3GXKSQ2N"
CString sha1urn        = sha1value.toUrn();        // "urn:sha1:VL2MMHO4YXUKFWV63YHTWSBM3GXKSQ2N"

CString tigerstring    = tigervalue.toString();    //                 "HGHPJWCDKPF6B6BRUZCBR4YBFJKBSSKHE4MG53I"
CString tigershorturn  = tigervalue.toShortUrn();  //     "tree:tiger/:HGHPJWCDKPF6B6BRUZCBR4YBFJKBSSKHE4MG53I"
CString tigerurn       = tigervalue.toUrn();       // "urn:tree:tiger/:HGHPJWCDKPF6B6BRUZCBR4YBFJKBSSKHE4MG53I"

CString donkeystring   = donkeyvalue.toString();   //              "866437cb7a794bce2b727acc0362ee27"
CString donkeyshorturn = donkeyvalue.toShortUrn(); //         "ed2k:866437cb7a794bce2b727acc0362ee27"
CString donkeyurn      = donkeyvalue.toUrn();      // "urn:ed2khash:866437cb7a794bce2b727acc0362ee27"

MD5 is base 16 lowercase, with headers md5: and urn:md5:
SHA1 is base 32 uppercase, with headers sha1: and urn:sha1:
TigerTree is base 32 uppercase, with headers tree:tiger/: and urn:tree:tiger/:
eDonkey2000 is base 16 lowercase, with headers ed2k: and urn:ed2khash: