summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/Net/OpenID/HMACSHA1.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/Tests/Net/OpenID/HMACSHA1.php b/Tests/Net/OpenID/HMACSHA1.php
index 74d85bb..a184078 100644
--- a/Tests/Net/OpenID/HMACSHA1.php
+++ b/Tests/Net/OpenID/HMACSHA1.php
@@ -47,12 +47,7 @@ class Tests_Net_OpenID_HMACSHA1 extends PHPUnit_TestSuite {
$data .= $c;
}
} elseif (substr($s, 0, 2) == "0x") {
- $size = strlen($s);
- $data = '';
- for ($i = 2; $i < $size; $i += 2) {
- $byte = substr($s, $i, 2);
- $data .= chr(hexdec($byte));
- }
+ $data = pack('H*', substr($s, 2, strlen($s) - 1));
} elseif (preg_match('/^"(.*)"$/', $s, $match)) {
$data = $match[1];
} else {