mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 13:55:03 -04:00
print peer id in 0 padded hex for consistency
This commit is contained in:
parent
8f8cc09ba1
commit
5524bc3151
4 changed files with 29 additions and 22 deletions
|
@ -314,6 +314,18 @@ POP_WARNINGS
|
|||
return str;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
inline std::string pad_string(std::string s, size_t n, char c = ' ', bool prepend = false)
|
||||
{
|
||||
if (s.size() < n)
|
||||
{
|
||||
if (prepend)
|
||||
s = std::string(n - s.size(), c) + s;
|
||||
else
|
||||
s.append(n - s.size(), c);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
template<class t_pod_type>
|
||||
std::string pod_to_hex(const t_pod_type& s)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue