Вопрос

How to convert from cryptopp::integer to QString?

If it's important I work on Mac OS. I absolutely don't know what to do, only trying to use QCA, but it wasn't good enough!

Это было полезно?

Решение 2

Based on your feedback to my comment, it seems that you need three steps.

1) Call the BitCount() method to get the number of bits in the integer.

2) Then, you can get all the bits by using the GetBits() method.

3) Once that is done, you can call use the QString::number() method to get the actual integer into the desiredQString` as the return value of the static method.

Другие советы

How to convert from cryptopp::integer to QString?

You could also do something like this:

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

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

QString qs(oss.str().c_str());
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top