MCPcopy Create free account
hub / github.com/defold/defold / BytesToHexString

Function BytesToHexString

engine/resource/src/resource_util.cpp:57–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void BytesToHexString(const uint8_t* byte_buf, uint32_t byte_buf_len, char* out_buf, uint32_t out_len)
58{
59 if (out_buf != NULL && out_len > 0)
60 {
61 uint32_t out_len_cond = (out_len + 1) / 2;
62 out_buf[0] = 0x0;
63 for (uint32_t i = 0; i < byte_buf_len; ++i)
64 {
65 char current[3];
66 dmSnPrintf(current, 3, "%02x", byte_buf[i]);
67
68 if (i < out_len_cond)
69 strncat(out_buf, current, 1);
70 if (i+1 < out_len_cond)
71 strncat(out_buf, current+1, 1);
72 else
73 break;
74 }
75 }
76}
77
78Result CreateResourceHash(dmLiveUpdateDDF::HashAlgorithm algorithm, const uint8_t* buf, size_t buflen, uint8_t* digest)
79{

Callers 7

VerifyResourcesBundledFunction · 0.85
VerifyResourceFunction · 0.85
VerifyArchiveIndexFunction · 0.85
GetProjectIdFunction · 0.85
CreateEntryMapFunction · 0.85
TESTFunction · 0.85
GetResourceHashCallbackFunction · 0.85

Calls 1

dmSnPrintfFunction · 0.85

Tested by 1

TESTFunction · 0.68