Re: Printing an `Integer` as hex appends an 'h'

Jeffrey Walton <[email protected]>
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <CAH8yC8mDMhThpMqajZwFtOMcoVkfZ=3W1gzWZLOuPU2ejJ=LoQ@mail.gmail.com>
On Wed, Dec 30, 2020 at 9:08 PM Addy <[email protected]> wrote:
>
> If I do this:
>
> std::uint64_t x = 100;
> std::cout << std::hex << x;
>
> The output is: 64
>
> If I instead do this:
>
> CryptoPP::Integer x1 = 100;
> std::cout << std::hex << x1;
>
> The output is: 64h
>
> From where is this "h" coming and how do I get rid of it?

Yeah, I've never really liked that behavior either. Unfortunately, the
behavior is ingrained in the library. We could not change the default
even if we wanted to. It would break too many programs.

To turn off the suffixes, see
https://www.cryptopp.com/wiki/Integer_Patch#std::showbase_and_Suffixes.

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/CAH8yC8mDMhThpMqajZwFtOMcoVkfZ%3D3W1gzWZLOuPU2ejJ%3DLoQ%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.