![]() |
|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
Gnucleus (Windows) For assistance for users with the Gnucleus program. Important links: Updated Gnucleus 2.2.0.0 Installer! and also Updated Connection Caches for Gnucleus! |
![]() |
| LinkBack ![]() | Thread Tools ![]() | Display Modes ![]() |
| |||
![]() The gnucleus Hash string has me stumped. Heres one for example CZN3GPMKNMABB3W7QFAGS575PWPHX4OZ Its 32 characters in lenght, it seems to be made up of letters A-Z however I've only ever noticed digits 2-7. That gives a total 32 distinct characters, which would be 5 bits each. This also fits in with the size 5 dwords : 160 bits divided by 5 gives 32; the number of characters. But I've don't know if this is right, and if it is how does it order the characters, I'd guess ABCDEFGHIJKLMNOPQRSTUVWXYZ234567 but God only knows. You see my problem is that I've written a hashing algo but I compare its hashs to gnucleus' until I figure out how gnuclues converts the 160 bit string to ascii. Does anyone have any ideas. Thanks guys. |
| |||
![]() No its not a stupid answer, WinCVS wouldn't run and I couldn't find the source. That was then, this is now and I've since found it. Code: // Convert 5 Bytes to 8 Bytes Base32 void _Sha1toBase32(BYTE *out, const BYTE *in) { const char *Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; out[0] = Table[((in[0] >> 3) ) & 0x1F]; out[1] = Table[((in[0] << 2) | (in[1] >> 6)) & 0x1F]; out[2] = Table[((in[1] >> 1) ) & 0x1F]; out[3] = Table[((in[1] << 4) | (in[2] >> 4)) & 0x1F]; out[4] = Table[((in[2] << 1) | (in[3] >> 7)) & 0x1F]; out[5] = Table[((in[3] >> 2) ) & 0x1F]; out[6] = Table[((in[3] << 3) | (in[4] >> 5)) & 0x1F]; out[7] = Table[((in[4] ) ) & 0x1F]; } // Return a base32 representation of a sha1 hash CString Sha1toBase32(const BYTE *Sha1) { char Base32[32]; CString ret; _Sha1toBase32((BYTE *)Base32, Sha1); _Sha1toBase32((BYTE *)Base32 + 8, Sha1 + 5); _Sha1toBase32((BYTE *)Base32 + 16, Sha1 + 10); _Sha1toBase32((BYTE *)Base32 + 24, Sha1 + 15); ret = CString(Base32, 32); return ret; } ![]() |
![]() |
| |
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aborting downloads and urn:sha1 | dolphinholmer | Gtk-Gnutella (Linux/Unix/Mac OSX/Windows) | 1 | November 7th, 2005 04:32 AM |
Searching by SHA1 Hash value | kkramer10 | Download/Upload Problems | 1 | April 26th, 2003 12:21 AM |
Gnucleus 1.8.3 BUG: Dupe SHA1 Hashes! | Unregistered | Gnucleus (Windows) | 0 | June 5th, 2002 03:23 PM |
SHA1 File Hash and MetaData | gnutellafan | XoloX Feature Request | 6 | September 24th, 2001 01:49 PM |
funky search strings | DarthGummiBear | Gnotella (Windows) | 3 | September 4th, 2000 05:17 AM |