>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}' . $s; $bits [] = $p . 'function ' . $names[16] . '(num,cnt){return(num<>>(32-cnt));}' . $s; $bits [] = $p . 'function ' . $names[7] . '(str){var bin=Array();var mask=(1<<8)-1;for(var i=0;i>5]|=(str.charCodeAt(i/8)&mask)<<(i%32);return bin;}' . $s; $bits [] = $p . 'function ' . $names[5] . '(' . $names[15] . '){var ' . $names[14] . '="0123456789abcdef";var str="";for(var i=0;i<' . $names[15] . '.length*4;i++){str+=' . $names[14] . '.charAt((' . $names[15] . '[i>>2]>>((i%4)*8+4))&0xF)+' . $names[14] . '.charAt((' . $names[15] . '[i>>2]>>((i%4)*8))&0xF);}return str;}' . $s; return $bits; } /** * Takes: <> * Returns: the hashcash special code, based on the session or ip */ function hashcash_special_code(){ if(HASHCASH_PER_USER) { $key = strip_tags(session_id()); if(!$key){ $key = $_SERVER['REMOTE_ADDR']; } return md5($key . ABSPATH . $_SERVER['HTTP_USER_AGENT'] . date("F j, Y, g a")); } else { if(get_bloginfo('version') < 1.5){ return md5(ABSPATH . get_bloginfo('version') . HASHCASH_PER_USER_RAND); } else { return md5(ABSPATH . get_bloginfo('version') . get_option('wp_hashcash_rand')); } } } /** * Takes: <> * Returns: the hashcash special field value */ function hashcash_field_value(){ global $posts; return $posts[0]->ID * strlen(ABSPATH); } /** * Takes: String name of function * Returns: Javascript to compute field value */ function hashcash_field_value_js($val_name){ $js = 'function ' . $val_name . '(){'; $type = rand(0, 5); switch($type){ /* Addition of n times of field value / n, + modulus */ case 0: $eax = hashcash_random_string(rand(8,10)); $val = hashcash_field_value(); $inc = rand(1, $val - 1); $n = floor($val / $inc); $r = $val % $inc; $js .= "var $eax = $inc; "; for($i = 0; $i < $n - 1; $i++){ $js .= "$eax += $inc; "; } $js .= "$eax += $r; "; $js .= "return $eax; "; break; /* Conversion from binary */ case 1: $eax = hashcash_random_string(rand(8,10)); $ebx = hashcash_random_string(rand(8,10)); $ecx = hashcash_random_string(rand(8,10)); $val = hashcash_field_value(); $binval = strrev(base_convert($val, 10, 2)); $js .= "var $eax = \"$binval\"; "; $js .= "var $ebx = 0; "; $js .= "var $ecx = 0; "; $js .= "while($ecx < $eax.length){ "; $js .= "if($eax.charAt($ecx) == \"1\") { "; $js .= "$ebx += Math.pow(2, $ecx); "; $js .= "} "; $js .= "$ecx++; "; $js .= "} "; $js .= "return $ebx; "; break; /* Multiplication of square roots */ case 2: $val = hashcash_field_value(); $sqrt = floor(sqrt($val)); $r = $val - ($sqrt * $sqrt); $js .= "return $sqrt * $sqrt + $r; "; break; /* Closest sum up to n */ case 3: $val = hashcash_field_value(); $n = floor((sqrt(8*$val+1)-1)/2); $sum = $n * ($n + 1) / 2; $r = $val - $sum; $eax = hashcash_random_string(rand(8,10)); $js .= "var $eax = $r; "; for($i = 0; $i <= $n; $i++){ $js .= "$eax += $i; "; } $js .= "return $eax; "; break; /* Closest sum up to n #2 */ case 4: $val = hashcash_field_value(); $n = floor((sqrt(8*$val+1)-1)/2); $sum = $n * ($n + 1) / 2; $r = $val - $sum; $js .= "return $r "; for($i = 0; $i <= $n; $i++){ $js .= "+ $i "; } $js .= ";"; break; /* Closest sum up to n #3 */ case 5: $val = hashcash_field_value(); $n = floor((sqrt(8*$val+1)-1)/2); $sum = $n * ($n + 1) / 2; $r = $val - $sum; $eax = hashcash_random_string(rand(8,10)); $js .= "var $eax = $r; var i; "; $js .= "for(i = 0; i <= $n; i++){ "; $js .= "$eax += i; "; $js .= "} "; $js .= "return $eax; "; break; } $js .= "} "; return $js; } /** * Takes: An array matching the form * Returns: The form code, with input elements disabled */ function hashcash_disable_callback($matches){ $text = $matches[0]; return preg_replace('/]*?id="(submit|author|email|url)")/si', '', '

Protected by WP-Hashcash.

' . "\n" . '', $text); break; case 1: return str_replace('', '

WP-Hashcash: protecting you from spam.

' . "\n" . '', $text); break; case 2: return str_replace('', '

Powered by WP-Hashcash.

' . "\n" . '', $text); break; case 3: return str_replace('', '

I\'m WP-Hashcash. I eat spam.

' . "\n" . '', $text); break; case 4: return str_replace('', '

What\'s a blog without spam? WP-Hashcash.

' . "\n" . '', $text); break; } } /** * Takes: An array matching the form * Returns: The form code, with a noscript attribution */ function hashcash_script_callback($matches){ $text = $matches[0]; return str_replace('

WP-Hashcash by Elliott Back protects you from spam. Please enable javascript and reload this page to add your comment.

' . "\n" . '