PHP-OpenID-0.0.8.3 released
Dan Libby
danda at videntity.org
Thu Sep 15 14:56:24 PDT 2005
Taral wrote:
>I took a glance... I notice you call out to python/perl if bcpowmod
>isn't around. It is possible to write bcpowmod in terms of other bc*
>functions, but it's kind of slow...
>
>
>
You're right. Since bcpowmod is php5-only and bcmath is pretty commonly
installed on php 4.x, it is best to support the old functions. Here is
a patch that does so. It will also be in the next release.
regards,
Dan Libby
--- oid_util.php 16 Sep 2005 00:05:56 -0000 1.2
+++ oid_util.php 16 Sep 2005 01:05:31 -0000 1.3
@@ -348,6 +348,9 @@
else if( function_exists( 'bcpowmod' ) ) {
return bcpowmod( $base, $exponent, $modulus );
}
+ else if( function_exists( 'bcpow' ) && function_exists( 'bcmod'
) ) {
+ return bcmod(bcpow($base, $exponent), $modulus);
+ }
// Warning: here we give up on php and call python or perl to
help us out.
// I'd like to replace this with native php code. Anyone know of
// a good/fast implementation of powmod in php?
More information about the yadis
mailing list