#include "I3Identifier.h"#include "SHA1.h"Go to the source code of this file.
Functions | |
| std::ostream & | operator<< (std::ostream &os, const I3Identifier &id) |
Definition in file I3Identifier.cc.
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const I3Identifier & | id | |||
| ) |
| os | String stream | |
| id | I3Identifier to be output |
Definition at line 195 of file I3Identifier.cc.
{
bool allzeros;
const char hex[] = "0123456789abcdef";
string s0, s1;
if (id.name.length() != 0) {
os << "(" << id.name << ") ";
}
for (int i = 0; i < id.prefixLength / 8; i++) {
os << hex[id.key[i] >> 4];
os << hex[id.key[i] & 0xf];
}
os << ':';
allzeros = true;
for (int i = id.prefixLength / 8; i < id.keyLength / 8; i++) {
if (id.key[i] != 0) {
allzeros = false;
break;
}
}
if (allzeros) {
os << "0...";
} else {
for (int i = id.prefixLength / 8; i < id.keyLength / 8; i++) {
os << hex[id.key[i] >> 4];
os << hex[id.key[i] & 0xf];
}
}
return os;
}
1.7.1