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

Function parsePublicKeyFromHex

src/cli.cpp:35–42  ·  view source on GitHub ↗

Helper: parse a hex string into a PublicKey (array )

Source from the content-addressed store, hash-verified

33
34// Helper: parse a hex string into a PublicKey (array<uint8_t, 32>)
35static PublicKey parsePublicKeyFromHex(const std::string &hex) {
36 std::vector<uint8_t> bytes = fromHex(hex);
37 if (bytes.size() != 32)
38 throw std::runtime_error("Invalid pubkey length");
39 PublicKey arr;
40 std::copy(bytes.begin(), bytes.end(), arr.begin());
41 return arr;
42}
43
44// Helper: parse a hex string into a WinternitzAddress (64-byte format: 32-byte
45// publicSeed + 32-byte publicKeyHash)

Callers

nothing calls this directly

Calls 1

fromHexFunction · 0.85

Tested by

no test coverage detected