MCPcopy Create free account
hub / github.com/QuipNetwork/cpp-sdk / toHex

Function toHex

include/common.hpp:35–48  ·  view source on GitHub ↗

Common functions

Source from the content-addressed store, hash-verified

33
34// Common functions
35inline string toHex(const vector<uint8_t> &data) {
36 string result;
37 result.reserve(data.size() * 2);
38 for (uint8_t byte : data) {
39 char hex[3];
40 snprintf(hex, sizeof(hex), "%02x", byte);
41 result += hex;
42 }
43 // Only add '0x' if not already present
44 if (result.rfind("0x", 0) == 0) {
45 return result;
46 }
47 return "0x" + result;
48}
49
50inline string toHex(const array<uint8_t, 32> &data) {
51 string result;

Callers 12

changePqOwnerMethod · 0.85
handleDepositMethod · 0.85
handleTransferMethod · 0.85
handleExecuteMethod · 0.85
handleChangePqOwnerMethod · 0.85
handleGenerateKeypairMethod · 0.85
handleRecoverKeypairMethod · 0.85
handleSignMethod · 0.85
depositToWinternitzMethod · 0.85
getQuipWalletAddressMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected