There’s so much to say I’ll say none of it.

February 22nd, 2010

I obviously haven’t been sticking to my plan to update this blog. Even so, there’s a few things I’ve considered posting about. Perhaps I’ll get round to those.

First post mentions driving test. I did pass and did buy a bicycle that same day. However, the following week I lost my job so didn’t get round to forking out huge expense on a car or insurance.

Right now I’m just starting to get back into having an income and being able to support myself. About 9 months is a typical gap between jobs for me, it seems.

I’ve got about three projects on the go. Two I’ve pretty much abandoned in favour of the largest. Ultimately they all seem to compliment each other in some way (that is the larger makes use of some data the smaller two provide or help to improve).

I’ll be announcing these once I get anywhere near some sort of completion.

For now, that’s all.

eD2k hash generation in PHP

January 12th, 2010

Spent some time last night fixing a function I wrote ages ago to generate an ed2k hash for a given file. I then failed to test and fix it with regard to files larger than the chunk size (9,728,000 bytes).

Here’s an updated version:

function ed2kHash_file ($name) {
	# Calculates eDonkey2000 hash for any given file
	# By: Tom Higginson
	# Date: 9th January 2008
	# Modified: 11th January 2010
	# License: Public domain

	$chunkSize = 9728000;
	$md4str = '';

	if( !file_exists( $name ) ) {
		return false;
	}

	if( filesize( $name ) < $chunkSize ) {
		return hash_file( 'md4', $name );
	} else {
		$fH = fopen( $name, 'r' );
		while( !feof( $fH ) ) {
			$md4str .= hash( 'md4', fread( $fH, $chunkSize ), true );
		}

		fclose( $fH );

		return hash( 'md4', $md4str );
	}
}

Here's some more about the eD2k hash: http://en.wikipedia.org/wiki/Ed2k_URI_scheme

Blog 2.0

June 14th, 2009

I’ve decided to start this blog again after accidentally joining a discussion about using social media for Shift Time festival, happening in Shrewsbury later this month.

I’ve nothing to post about right now except I’m about to listen to Fanfarlo album, which I bought because they’re currently selling whole album by download for $1.

Also looking at various bicycles in order to buy one tomorrow afternoon if I manage to pass my driving test, which I’m currently also studying for.

Fun :)