58 if (c <= '9' && c >=
'0')
62 else if (c <= 'f' && c >=
'a')
66 else if (c <= 'F' && c >=
'A')
83 return 'A' + (char)l - 10;
93 return toByte(hex[pos], hex[pos + 1]);
102 std::string ret =
" ";
103 ret[0] =
toHex(
byte >> 4);
104 ret[1] =
toHex(
byte & 0x0F);
110 append.push_back(
toHex(
byte >> 4));
111 append.push_back(
toHex(
byte & 0x0F));
118 for (
unsigned i = 0; i <
length; i++)
120 ret[i * 2] =
toHex(buf[i] >> 4);
121 ret[i * 2 + 1] =
toHex(buf[i] & 0x0F);
__device__ __2f16 float c
static __inline__ uint8_t
uint8_t toByte(char h, char l)
converts 2 hex characters to a byte
std::string fromByte(uint8_t byte)
converts a byte to a hex string (without "0x" prefix);
std::string fromBytes(uint8_t *buf, size_t length)
converts a sequence of bytes to a representing hex string (without "0x" prefix)
uint8_t fromHex(char c)
convert a character to the hex value it represents(0-15)
char toHex(uint8_t l)
converts the lower 4 bits to a representing char
float __ovld __cnfn length(float p)
Return the length of vector p, i.e., sqrt(p.x2 + p.y 2 + ...)