MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / hexEncode

Function hexEncode

source/core/StarEncode.cpp:5–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace Star {
4
5size_t hexEncode(char const* data, size_t len, char* output, size_t outLen) {
6 static char const hex[] = "0123456789abcdef";
7
8 len = std::min(len, outLen / 2);
9 for (size_t i = 0; i < len; ++i) {
10 output[i * 2] = hex[(data[i] & 0xf0) >> 4];
11 output[i * 2 + 1] = hex[(data[i] & 0x0f)];
12 }
13
14 return len * 2;
15}
16
17size_t hexDecode(char const* src, size_t len, char* output, size_t outLen) {
18 for (size_t i = 0; i < len / 2; ++i) {

Callers 10

assetsMethod · 0.85
inspectionLogNameMethod · 0.85
toHexMethod · 0.85
StarByteArray.cppFile · 0.85
temporaryFileNameMethod · 0.85
temporaryDirectoryMethod · 0.85
hexMethod · 0.85
hexStringFromUtf32Function · 0.85
temporaryFileNameMethod · 0.85
temporaryDirectoryMethod · 0.85

Calls 2

sizeMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected