Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > GnucDNA Based Clients > Gnucleus (Windows)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Search Today's Posts Mark Forums Read

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
Prev Previous Post   Next Post Next
  #3 (permalink)  
Old June 5th, 2002
Apprentice
 
Join Date: May 2nd, 2002
Location: Five paces forward, two left.
Posts: 5
Eoin is flying high
Default

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;
}
I still can't get this bloody thing to work though, I'll figre it out.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
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


All times are GMT -7. The time now is 12:28 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.