1
0
Fork 0
mirror of https://github.com/eosswedenorg/libantelope synced 2026-06-16 19:50:01 +02:00

src/ec.cpp: in _hex() append leading zero if value is <= 0xF

This commit is contained in:
Henrik Hautakoski 2023-03-16 12:09:29 +01:00
parent 6c6c7e2329
commit d904fd38c3

View file

@ -26,7 +26,13 @@
std::ostream& _hex(std::ostream& os, const unsigned char *b, std::size_t sz) {
os << "[ " << std::hex;
for (int i = 0; i < sz; i++) {
os << "0x" << ((int) b[i]) << " ";
unsigned int v = b[i];
os << "0x";
if (v <= 0xF) {
os << "0";
}
os << v << " ";
}
return os << std::oct << "]";
}