Common_Util.h 514 B

123456789101112131415161718192021222324252627
  1. #ifndef __COMMON_UTIL_H
  2. #define __COMMON_UTIL_H
  3. #include <stdint.h>
  4. /**
  5. * 整形字符串转整形数字
  6. */
  7. int my_atoi(char *str);
  8. /**
  9. * 整形转字符串
  10. * num:待转的数据,str:目标地址,radix:进制2,8,10,16
  11. */
  12. char* my_itoa(int num,char* str,int radix);
  13. //字节流转HEX字符串
  14. void byteToHexStr(const unsigned char* source, char* dest, int sourceLen);
  15. void bytesToHex(char * dest, uint8_t * source, uint16_t source_length);
  16. uint8_t memmem(uint8_t * result,uint16_t result_length, uint8_t *rdystring,uint8_t rdylen);
  17. #endif