MCPcopy Create free account
hub / github.com/ddnet/ddnet / str_hex

Function str_hex

src/base/str.cpp:581–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579}
580
581void str_hex(char *dst, int dst_size, const void *data, int data_size)
582{
583 static const char hex[] = "0123456789ABCDEF";
584 int data_index;
585 int dst_index;
586 for(data_index = 0, dst_index = 0; data_index < data_size && dst_index < dst_size - 3; data_index++)
587 {
588 dst[data_index * 3] = hex[((const unsigned char *)data)[data_index] >> 4];
589 dst[data_index * 3 + 1] = hex[((const unsigned char *)data)[data_index] & 0xf];
590 dst[data_index * 3 + 2] = ' ';
591 dst_index += 3;
592 }
593 dst[dst_index] = '\0';
594}
595
596void str_hex_cstyle(char *dst, int dst_size, const void *data, int data_size, int bytes_per_line)
597{

Callers 3

ShowInfoMethod · 0.85
ProcessClientPacketMethod · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68