const Identifier PaymentCode::ID() const { uint8_t core[65]{}; OTData pubkey = Pubkey(); OTPassword::safe_memcpy( &core[0], 33, pubkey.GetPointer(), pubkey.GetSize(), false); if (chain_code_.GetSize() == 32) { OTPassword::safe_memcpy( &core[33], 32, chain_code_.GetPointer(), chain_code_.GetSize(), false); } OTData dataVersion(core, sizeof(core)); Identifier paymentCodeID; paymentCodeID.CalculateDigest(dataVersion); return paymentCodeID; }
XMLElementParser& pushElement(const XMLElement& element) { if(string_equal(element.name(), m_elementName.c_str())) { Version dataVersion(version_parse(element.attribute("version"))); if(version_compatible(m_version, dataVersion)) { m_compatible = true; return m_parser; } else { return m_skip; } } else { //ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\""); return *this; } }