MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Encode

Method Encode

src/key.cpp:317–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
318 code[0] = nDepth;
319 memcpy(code+1, vchFingerprint, 4);
320 code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF;
321 code[7] = (nChild >> 8) & 0xFF; code[8] = (nChild >> 0) & 0xFF;
322 memcpy(code+9, chaincode.begin(), 32);
323 code[41] = 0;
324 assert(key.size() == 32);
325 memcpy(code+42, key.begin(), 32);
326}
327
328void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
329 nDepth = code[0];

Callers 2

EncodeExtPubKeyFunction · 0.45
EncodeExtKeyFunction · 0.45

Calls 3

memcpyFunction · 0.85
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected