Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 As3 BigInteger返回不正确的答案_Actionscript 3_Flash_Biginteger - Fatal编程技术网

Actionscript 3 As3 BigInteger返回不正确的答案

Actionscript 3 As3 BigInteger返回不正确的答案,actionscript-3,flash,biginteger,Actionscript 3,Flash,Biginteger,我正在尝试在flash中实现RSA加密程序。我研究了如何处理大数字,并在Crypto包中找到了BigInteger变量类型。我开始玩弄大整数,但我的输出从来都不是正确的答案。例如,当答案应该是9409时,下面的代码将输出5911。有关此错误的任何输入都将非常有用 var temp:BigInteger = new BigInteger(String(97)); temp = temp.pow(2); trace(temp.toString()); Output = 5911 我不确定您指的是

我正在尝试在flash中实现RSA加密程序。我研究了如何处理大数字,并在Crypto包中找到了BigInteger变量类型。我开始玩弄大整数,但我的输出从来都不是正确的答案。例如,当答案应该是9409时,下面的代码将输出5911。有关此错误的任何输入都将非常有用

var temp:BigInteger = new BigInteger(String(97));
temp = temp.pow(2);
trace(temp.toString());

Output = 5911

我不确定您指的是哪个加密包,我想是的,但我不记得它的实现有一个具有该签名的
pow
方法。但无论哪种方式,您都必须始终记住您要处理的是什么基础,以及库的设计目的

(9716)2=591116

您处理的是十六进制数字,而不是十进制数字


想想那件极客时尚t恤,上面写着“有10种人,懂二进制的和不懂二进制的”。在这种情况下,假设“10”为102。等于210。不合格的基地几乎总是毁掉每一天。

非常感谢你解决了这个问题!