MCPcopy Create free account
hub / github.com/ElementsProject/elements / Encode

Method Encode

src/key.cpp:379–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
380 code[0] = nDepth;
381 memcpy(code+1, vchFingerprint, 4);
382 WriteBE32(code+5, nChild);
383 memcpy(code+9, chaincode.begin(), 32);
384 code[41] = 0;
385 assert(key.size() == 32);
386 memcpy(code+42, key.begin(), 32);
387}
388
389void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
390 nDepth = code[0];

Callers 2

EncodeExtPubKeyFunction · 0.45
EncodeExtKeyFunction · 0.45

Calls 3

WriteBE32Function · 0.50
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected