--- oauth/oauth.lib.php	2009-05-29 15:00:48.000000000 -0400
+++ oauth/oauth.lib.php.new	2010-10-19 01:57:52.000000000 -0400
@@ -1,4 +1,30 @@
 <?php
+if ( !function_exists('hash_hmac') ){
+	//Calculate HMAC-SHA1 according to RFC2104
+	// http://www.ietf.org/rfc/rfc2104.txt
+	function hash_hmac($algo, $data, $key, $raw_output = false) {
+	   $blocksize=64;
+	   if (strlen($key)>$blocksize)
+	       $key=pack('H*', $algo($key));
+	   $key=str_pad($key,$blocksize,chr(0x00));
+	   $ipad=str_repeat(chr(0x36),$blocksize);
+	   $opad=str_repeat(chr(0x5c),$blocksize);
+	   $hmac = pack(
+	               'H*',$algo(
+	                   ($key^$opad).pack(
+	                       'H*',$algo(
+	                           ($key^$ipad).$data
+	                       )
+	                   )
+	               )
+	           );
+	   if ($raw_output)
+	       return $hmac;
+	   else
+	       return bin2hex($hmac);
+	}
+}
+
 // $Id: oauth.lib.php,v 1.1.2.4 2009/05/29 19:00:48 brmassa Exp $
 /**
  * @author Andy Smith
