# | Line 126 | Line 126 | time_dissect(time_t duration) | |
---|---|---|
126 | days, days == 1 ? "" : "s", hours, minutes, seconds); | |
127 | return buf; | |
128 | } | |
129 | + | |
130 | + | void |
131 | + | binary_to_hex(const unsigned char *bin, char *hex, unsigned int length) |
132 | + | { |
133 | + | static const char trans[] = "0123456789ABCDEF"; |
134 | + | |
135 | + | for (const unsigned char *const end = bin + length; bin < end; ++bin) |
136 | + | { |
137 | + | *hex++ = trans[*bin >> 4]; |
138 | + | *hex++ = trans[*bin & 0xf]; |
139 | + | } |
140 | + | |
141 | + | *hex = '\0'; |
142 | + | } |
– | Removed lines |
+ | Added lines |
< | Changed lines (old) |
> | Changed lines (new) |