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:
parent
6c6c7e2329
commit
d904fd38c3
1 changed files with 7 additions and 1 deletions
|
|
@ -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 << "]";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue