23,217
社区成员




void HexToAscii(char *t, const char *s, int l)
{
int i;
unsigned char c;
if( t == NULL || s == NULL ) return;
for( i = 0; i < l; i++ )
{
c = (s[i] >> 4) & 0x0F;
t[2*i] = (c <= 0x9) ? c + 0x30 : c + 0x37;
c = s[i] & 0x0F;
t[2*i + 1] = (c <= 0x9) ? c + 0x30 : c + 0x37;
}
t[2*i] = 0;
}