MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FormatArrayAsHex

Function FormatArrayAsHex

src/string.cpp:77–87  ·  view source on GitHub ↗

* Format a byte array into a continuous hex string. * @param data Array to format * @return Converted string. */

Source from the content-addressed store, hash-verified

75 * @return Converted string.
76 */
77std::string FormatArrayAsHex(std::span<const uint8_t> data)
78{
79 std::string str;
80 str.reserve(data.size() * 2 + 1);
81
82 for (auto b : data) {
83 format_append(str, "{:02X}", b);
84 }
85
86 return str;
87}
88
89/**
90 * Test if a character is (only) part of an encoded string.

Callers 15

GRFSaveConfigFunction · 0.85
WriteSavegameInfoFunction · 0.85
ShowNewGRFInfoFunction · 0.85
AddGrfInfoFunction · 0.85
SurveyGrfsFunction · 0.85
LogCommandExecutionMethod · 0.85
OutputContentStateFunction · 0.85
IsGoodGRFConfigListFunction · 0.85
GenerateUidFunction · 0.85
CalculateHashV1Function · 0.85
MakeImageMethod · 0.85
SetLastCommandMethod · 0.85

Calls 3

format_appendFunction · 0.85
reserveMethod · 0.80
sizeMethod · 0.45

Tested by 1