mirror of
https://github.com/eosswedenorg/libantelope
synced 2026-08-23 20:28:12 +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) {
|
std::ostream& _hex(std::ostream& os, const unsigned char *b, std::size_t sz) {
|
||||||
os << "[ " << std::hex;
|
os << "[ " << std::hex;
|
||||||
for (int i = 0; i < sz; i++) {
|
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 << "]";
|
return os << std::oct << "]";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue