簡體   English   中英

從cryptopp :: integer轉換為QString

[英]Converting from cryptopp::integer to QString

怎么把cryptopp :: integer轉換成QString?

如果重要的話,我可以在Mac OS上工作。 我絕對不知道該怎么辦,僅嘗試使用QCA,但這還不夠好!

怎么把cryptopp :: integer轉換成QString?

您還可以執行以下操作:

CryptoPP::Integer i = 1;
i <<= 128;
i--;
i *= 3;

ostringstream oss;
oss << std::hex << i;

QString qs(oss.str().c_str());

根據您對我的評論的反饋,看來您需要三個步驟。

1)調用BitCount()方法以獲取整數中的位數。

2)然后,您可以使用GetBits()方法獲取所有位。

3)完成后,您可以調用使用QString::number() method to get the actual integer into the desired QString`作為靜態方法的返回值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM