ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/misc.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/misc.c (file contents):
Revision 7105 by michael, Sat Jan 23 20:11:27 2016 UTC vs.
Revision 7152 by michael, Thu Jan 28 10:24:03 2016 UTC

# 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 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)