{"id":254,"date":"2006-02-09T23:37:54","date_gmt":"2006-02-10T06:37:54","guid":{"rendered":"http:\/\/www.gubatron.com\/blog\/?p=254"},"modified":"2006-02-09T23:37:54","modified_gmt":"2006-02-10T06:37:54","slug":"create-base32-sha1-hashes-out-of-files-in-php-5","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/create-base32-sha1-hashes-out-of-files-in-php-5\/","title":{"rendered":"Create Base32 SHA1 hashes out of files in PHP 5"},"content":{"rendered":"<p>LimeWire and other Gnutella clients uniquely identify files by creating a SHA1 hash of the files.<\/p>\n<p>I thought that it might be useful to the gnutella network  to have regular webservers sharing legal files.<\/p>\n<p>Usually regular Joe webmasters don&#8217;t have permissions to run java programs or have tcp ports open due to their webhosting contracts, however most of them can run PHP script, and some hosting companies allow for PHP5. This post is to have one more reason to start moving to PHP5 and one small step towards having more websites distributing content straight to the Gnutella network.<br \/>\nA few weeks LimeWire developer Karl Magdsick developed a simple base32 converter in python, he was creating a simple gnutella servent, I thougt I could build a set of PHP5 scripts which could serve files out of magnet link requests, PHP has a sha1 function but it won&#8217;t return results in base32, and Karl&#8217;s script was the missing link. Today he gave me his python base32 converter which I just ported to PHP5 and I couldn&#8217;t wait one second to share it with you all.<br \/>\nThis will be the first step to building an open source Gnutella Server in PHP5.<\/p>\n<p><a href=\"http:\/\/www.gubatron.com\/blog\/wp-content\/uploads\/sha1.phps\">I release this utility class under the GPL, use it for Magnet links, and Gnutella file sharing as you please.<\/a><\/p>\n<p>Next possible steps:<\/p>\n<p>&#8211; Serving a file with a php5 script after a LimeWire client hitting the script from a magnetlink<\/p>\n<p>&#8211; Keep track of alternate locations<\/p>\n<p>&#8211; When serving the files, send Alt-Loc headers \ud83d\ude42<\/p>\n<p>&#8211; Make more scripts to easily manage\/share files on your server , and create a simple MySQL\/PHP5 based website that publishes magnet links.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LimeWire and other Gnutella clients uniquely identify files by creating a SHA1 hash of the files. I thought that it might be useful to the gnutella network to have regular webservers sharing legal files. Usually regular Joe webmasters don&#8217;t have permissions to run java programs or have tcp ports open due to their webhosting contracts, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[15,33],"tags":[],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-code","category-gubatron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-46","jetpack-related-posts":[{"id":994,"url":"https:\/\/www.gubatron.com\/blog\/new-frostwire-4172-for-windows-is-out\/","url_meta":{"origin":254,"position":0},"title":"New FrostWire 4.17.2 for Windows is out","author":"gubatron","date":"November 23, 2008","format":false,"excerpt":"Download FrostWire 4.17.2 for Windows CHANGELOG: Version 4.17.2 (November 2008) Fixes a newly introduced bug in Windows which would make FrostWire(tm) take over the .bittorrent file association without asking the user. Reduces DHT network load. The LimeWire team found out that the Mojito \u201cstore forwarding\u201d feature would not provide extra\u2026","rel":"","context":"In &quot;Geeklife&quot;","block_context":{"text":"Geeklife","link":"https:\/\/www.gubatron.com\/blog\/category\/geeklife\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":244,"url":"https:\/\/www.gubatron.com\/blog\/things-id-like-to-do\/","url_meta":{"origin":254,"position":1},"title":"Things I\u2019d like to do:","author":"gubatron","date":"January 25, 2006","format":false,"excerpt":"I'll put the list of things I'd like to do (code wise) to the public to see If I'm a bit embarrased and actually do em instead of talking about them: - Release a new version of wedoit4you.com, or fix the current one so the interface is cleaner, faster, and\u2026","rel":"","context":"In &quot;Diary&quot;","block_context":{"text":"Diary","link":"https:\/\/www.gubatron.com\/blog\/category\/diary\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":331,"url":"https:\/\/www.gubatron.com\/blog\/limewire-412-released-and-they-moved-my-name-further-down-on-the-credits\/","url_meta":{"origin":254,"position":2},"title":"LimeWire 4.12 Released! (And they moved my name further down on the credits)","author":"gubatron","date":"June 22, 2006","format":false,"excerpt":"Here's the release post on the LimeWire Blog Check out the credits of the software, I used to be on the Web Dev Team, my props to Andrew Fischler and best of luck to Dave Yeu, it's great to be a web dev for such an exciting site, I'm sure\u2026","rel":"","context":"In &quot;Diary&quot;","block_context":{"text":"Diary","link":"https:\/\/www.gubatron.com\/blog\/category\/diary\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":945,"url":"https:\/\/www.gubatron.com\/blog\/new-frostwire-4171-released\/","url_meta":{"origin":254,"position":3},"title":"New FrostWire 4.17.1 Released","author":"gubatron","date":"November 8, 2008","format":false,"excerpt":"Source FOR IMMEDIATE RELEASE: Official FrostWire 4.17.1 Download link FrostWire.com -- The last of the 4.17.x FrostWire series is finally out. The following is a list of the most important updates made for this release, which irons out most of the complains received from the community in regards to 4.17.0.\u2026","rel":"","context":"In &quot;FrostWire&quot;","block_context":{"text":"FrostWire","link":"https:\/\/www.gubatron.com\/blog\/category\/frostwire\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1210,"url":"https:\/\/www.gubatron.com\/blog\/geek-t-shirt-collection-14-frostwire\/","url_meta":{"origin":254,"position":4},"title":"Geek T-Shirt Collection #14 &#8211; FrostWire","author":"gubatron","date":"April 4, 2009","format":false,"excerpt":"This is the official FrostWire T-Shirt. I contribute to this open source project to keep my java skills up to date. We had a lot of these t-shirt printed to gather donations for the project. Thanks to the people that support us there's only a few left (only M size)\u2026","rel":"","context":"In &quot;Geeklife&quot;","block_context":{"text":"Geeklife","link":"https:\/\/www.gubatron.com\/blog\/category\/geeklife\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1336,"url":"https:\/\/www.gubatron.com\/blog\/compiling-ghost-white-crab-on-linux-x86_64-ubuntu-linux\/","url_meta":{"origin":254,"position":5},"title":"Compiling Ghost White Crab on Linux x86_64 Ubuntu Linux","author":"gubatron","date":"July 26, 2009","format":false,"excerpt":"Compiling this software is usually just a matter of running 'make', but if you try to do so in Ubuntu 64bit, you'll encounter the following error on the config_test.log file skipping incompatible \/usr\/lib\/gcc\/x86_64-linux-gnu\/4.3.3\/libgcc.a when searching for -lgcc To solve this issue just do the following: apt-get install libc6-dev-i386 This makes\u2026","rel":"","context":"In &quot;Geeklife&quot;","block_context":{"text":"Geeklife","link":"https:\/\/www.gubatron.com\/blog\/category\/geeklife\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":0,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}