69,369
社区成员
发帖
与我相关
我的任务
分享
void ByteToHex(const Byte *input,Int32 inlen,Byte *output)
{
Int32 i = 0;
while(i < inlen)
{
*output++ = tohex[input[i] >> 4];
*output++ = tohex[input[i] & 0x0F];
++i;
}
}
void HexToByte(const Byte *input,Int32 inlen,Byte *output)
{
Int32 i = 0,q = 0;
for(q=0; q<inlen; q+=2)
{
output[i] = CharToNum(input[q]) << 4;
output[i++] |= CharToNum(input[q+1]);
}
}