diff options
-rw-r--r-- | Net/OpenID/CryptUtil.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Net/OpenID/CryptUtil.php b/Net/OpenID/CryptUtil.php index ec83df4..2c75e20 100644 --- a/Net/OpenID/CryptUtil.php +++ b/Net/OpenID/CryptUtil.php @@ -72,6 +72,21 @@ class Net_OpenID_CryptUtil { return $bytes; } + function maxint() { + /** + * quick-and-dirty function for PHP int size -- assumes + * largest integer is of form 2^n - 1 + */ + $to_test = pow(2, 16); + while (1) { + $last = $to_test; + $to_test = 2 * $to_test; + if (($to_test < $last) || (!is_int($to_test))) { + return($last + ($last - 1)); + } + } + } + /** * Computes the SHA1 hash. * |