#ifndef tool_byte_h #define tool_byte_h #include #include struct tool_byte{ template static void memcpy_int(std::vector& msg, T val) { for(int i = sizeof(T) - 1; i>=0; --i) { msg.push_back((val>>(i*8))&0xff); } } static std::string to_cardid(const int ctype, const int cid) { char sz[20] = {0}; sprintf(sz, "%.3d%.10d", ctype, cid); return std::string(sz); } }; #endif