On 08/04/08 03:11 +0200, Peter Stuge wrote:
On Tue, Apr 08, 2008 at 02:41:23AM +0200, Uwe Hermann wrote:
+u8 bin2hex(u8 b) +{
- return "0123456789abcdef"[b & 15];
+}
Neat. :)
Hmm - now that you mention it - thats 16 bytes of const data. This might be more efficient (but not as cute):
return (b < 10) ? '0' + b : 'a' + (b - 10);
Jordan