[英]How to split the 2048 bits BigInteger into words with a fixed number of 64 bits?
[英]How can you specify a BigInteger with a maximum number of bits of type BigInteger?
我知道BigInteger有一個構造函數,您可以在其中通過傳遞新BigInteger的最大bitLength和一個隨機參數來生成隨機BigInteger:
BigInteger(int numBits, Random rnd)
如何生成一個隨機的BitInteger,其中numBits是BitInteger而不是int類型? 注意:我不想做myBitInteger.intValue()
。
你不能 沒有構造函數占用BigInteger
位數。
為什么不? BigInteger
不會在內部將位數存儲為大整數。 它擁有int
位,這是公共API中反映的設計決策:
BigInteger(int numBits, Random rnd);
int bitCount();
int bitLength();
static BigInteger probablePrime(int bitLength, Random rnd);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.