two bigass problems with titanium
1: super-loving-long compile time for one dinkyass application - we're talking 5-10 minutes for a one-screen application! probably just my computer, but it's still a problem
2: it's 8 loving megabytes big! fortunately it doesn't get much bigger nor much smaller than that, but it's still big!
3: i can't get this goddamned thing down. node.js just /worked!/ this crap is giving me errors all over the place. can you believe console isn't an object, despite being in the documentation? I couldn't either!
I'm thinking learning java might be easier than this.
I'm going to port this recursive hash calculation algorithm over to torquescript and see what kinds of speed I get out of it. Who wants to place bets on an average hashes per second in comparison to the other languages?
results from other languages:
Node.js: 30000
php: 8000 +/- 500
var crypto = require('crypto');
var HASH = "d5ec41e0a1a7771771037f27ae222827f36ef6d4";
var HASH_ALGO = 'sha1';
var PASSWORD_MAX_LENGTH = '8'
var charset = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
			  "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
			  "u", "v", "w", "x", "y", "z"];
var charset_length = charset.length;
var hashcount = 0;
var hashtotal = 0;
var ticks = 0;
var logtime = new Date().getSeconds();
function hash(algo, str) {
	hashcount++;
	hashtotal++;
	if(logtime < new Date().getSeconds()) {
		logtime = new Date().getSeconds();
		if(logtime == 59) { logtime = 0; }
		if(logtime != 0) {
			ticks++;
			console.log(hashcount + "\t" + hashtotal + "\t" + logtime + "\t" + ticks);
			hashcount = 0;
		}
	}
	return crypto.createHash(algo).update(str).digest('hex');
}
 
function check(password) {
    if (hash(HASH_ALGO, password) == HASH) {
        console.log('FOUND MATCH, password: ' + password);
        process.exit();
    }
}
 
 
function recurse(width, position, base_string) {
    for (var i = 0; i < charset_length; i++) {
        if (position < width - 1) {
            recurse(width, position + 1, base_string + charset[i]);
        }
        check(base_string + charset[i]);
    }
}
console.log("target hash: " + HASH);
recurse(PASSWORD_MAX_LENGTH, 0, '');
 
console.log("Execution complete, no password found");I'll also be slightly modifying it so it doesn't kill the main thread. forget that stuff, i'd actually have to think
 turns out it was a stuffty benchmark cause i'm using c++ functions :(
torquescript came out at 35k though
$HASH = "d5ec41e0a1a7771771037f27ae222827f36ef6d4";
$PASSWORD_MAX_LENGTH = "8";
$charset = "abcdefghijklmnopqrstuvwxyz";
$charset_length = strLen($charset);
$hashcount = 0;
$hashtotal = 0;
$ticks = 0;
$logtime = getRealTime();
function hash(%str) {
	$hashcount++;
	$hashtotal++;
	if($logtime < getRealTime() - 1000) {
		$logtime = getRealTime();
		$ticks++;
		echo($hashcount @ "\t" @ $hashtotal @ "\t" @ $logtime @ "\t" @ $ticks);
		$hashcount = 0;
	}
	return sha1(%str);
}
function recurse(%width, %position, %base_string) {
	for (%i = 0; %i < $charset_length; %i++) {
		if (%position < %width - 1) {
			recurse(%width, %position + 1, %base_string @ getSubStr($charset, %i, 1));
		}
		hash(%base_string @ getSubStr($charset, %i, 1));
	}
}
echo("target hash: " @ $HASH);
recurse($PASSWORD_MAX_LENGTH, 0, "");
 
echo("Execution complete, no password found");
SL4A does support networking if you use the php module and stuff
this is good