Unsigned char std::basic_string<> in C++
berthub.eu2026年01月03日 22:00
Brief post on a somewhat vexing and irritating C++ problem I ran into some time ago. I hope that this page will help other people deal with this problem more quickly than I did.
I’ve long used std::basic_string<uint8_t>, an unsigned char string, for fiddling with bits. You could use a regular char string, but especially when doing cryptographic or sub-byte operations, it is more convenient to not have to deal with sign bits.