使用 BCMath 时出错 - 调用未定义的方法 PEAR_Error::int2bin()
我在使用 BCMath 时遇到此错误 -
致命错误:调用未定义的方法 PEAR_Error::int2bin() login.php 第 23 行
我尝试将 Crypt_RSA 和 BCMath 一起使用。这是我的代码 -
require_once("Crypt/RSA/MathLoader.php");
$wrapper_name = “BCMath”;
$math_obj = &Crypt_RSA_MathLoader::loadWrapper($wrapper_name);
$a = $math_obj->int2bin("6465130539297209249500692895930266194225707667564124686892613724438982507603215802636578141547940687986170708901198917318074984831856438115515743080726101");
I am having this error while using BCMath -
Fatal error: Call to undefined method PEAR_Error::int2bin() in
login.php on line 23
I am trying to use Crypt_RSA and BCMath together. Here is my code -
require_once("Crypt/RSA/MathLoader.php");
$wrapper_name = “BCMath”;
$math_obj = &Crypt_RSA_MathLoader::loadWrapper($wrapper_name);
$a = $math_obj->int2bin("6465130539297209249500692895930266194225707667564124686892613724438982507603215802636578141547940687986170708901198917318074984831856438115515743080726101");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以几天前我在 php 中做一些加密时遇到了类似的问题。我需要将十进制数转换为其等价的二进制数。我所做的是将其转换为十六进制,然后将其解压为十六进制编码数据。
So i ran into a similar issue when I was doing some crypto in php just a few days ago. I needed to convert a decimal number into its binary equivalent. What I did was convert it to hex and then unpack it as hex encoded data.