summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-01-04 17:26:29 +0000
committertailor <cygnus@janrain.com>2006-01-04 17:26:29 +0000
commit380c3f781a8317621b9815ecb58a3cc1199a1eb5 (patch)
tree340a2b4e24e30739e9a422926148739c20ab109a
parentb43fe59d26c2c19408bd470b239921f7f1d4700c (diff)
downloadphp-openid-380c3f781a8317621b9815ecb58a3cc1199a1eb5.zip
php-openid-380c3f781a8317621b9815ecb58a3cc1199a1eb5.tar.gz
php-openid-380c3f781a8317621b9815ecb58a3cc1199a1eb5.tar.bz2
[project @ Fixed encoding for sha1 return value and fixed getBytes function call]
-rw-r--r--Net/OpenID/CryptUtil.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/Net/OpenID/CryptUtil.php b/Net/OpenID/CryptUtil.php
index 7f4d6de..d32511e 100644
--- a/Net/OpenID/CryptUtil.php
+++ b/Net/OpenID/CryptUtil.php
@@ -96,7 +96,7 @@ class Net_OpenID_CryptUtil {
* @return string The resulting SHA1 hash.
*/
function sha1($str) {
- return sha1($str, true);
+ return base64_decode(sha1($str));
}
/**
@@ -327,8 +327,8 @@ class Net_OpenID_CryptUtil {
* @return string $result A string of randomly-chosen characters from $chrs
*/
function randomString($length, $chrs = null) {
- if ($chrs == null) {
- return getBytes($length);
+ if ($chrs === null) {
+ return Net_OpenID_CryptUtil::getBytes($length);
} else {
$n = strlen($chrs);
$str = "";