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

Function nibbleDecode

source/core/StarEncode.cpp:46–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46size_t nibbleDecode(char const* src, size_t len, char* output, size_t outLen) {
47 for (size_t i = 0; i < len; ++i) {
48 if (i >= outLen)
49 return i;
50
51 uint8_t b = 0;
52 char c = src[i];
53 if (c >= '0' && c <= '9')
54 b = c - '0';
55 else if (c >= 'A' && c <= 'F')
56 b = c - 'A' + 10;
57 else if (c >= 'a' && c <= 'f')
58 b = c - 'a' + 10;
59
60 *output++ = b;
61 }
62
63 return len;
64}
65
66static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
67

Callers 2

hexToVec4BMethod · 0.85
imageOperationFromStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected