CatapultServer  v0.5.0.1 (Elephant)
Address.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "NetworkInfo.h"
23 #include "catapult/types.h"
24 #include <string>
25 
26 namespace catapult { namespace model {
27 
29  Address StringToAddress(const std::string& encoded);
30 
32  std::string AddressToString(const Address& address);
33 
35  Address PublicKeyToAddress(const Key& publicKey, NetworkIdentifier networkIdentifier);
36 
38  bool IsValidAddress(const Address& address, NetworkIdentifier networkIdentifier);
39 
42  bool IsValidEncodedAddress(const std::string& encoded, NetworkIdentifier networkIdentifier);
43 }}
catapult::utils::ByteArray::cbegin
constexpr auto cbegin() const noexcept
Returns a const iterator to the first byte.
Definition: ByteArray.h:81
exceptions.h
catapult::model::Checksum_Size
const uint8_t Checksum_Size
Definition: Address.cpp:29
catapult::crypto::Sha3_256
void Sha3_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit SHA3 hash of dataBuffer into hash.
Definition: Hashes.cpp:81
catapult::model::IsValidAddress
bool IsValidAddress(const Address &address, NetworkIdentifier networkIdentifier)
Returns a value indicating whether or not the given address is valid for the network identified by ne...
Definition: Address.cpp:70
catapult::utils::Base32Encode
void Base32Encode(const RawBuffer &data, const MutableRawString &encodedData)
Definition: Base32.cpp:116
catapult::utils::to_underlying_type
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
NetworkInfo.h
catapult::utils::ByteArray::data
constexpr const uint8_t * data() const noexcept
Returns a const pointer to the underlying array.
Definition: ByteArray.h:70
CATAPULT_THROW_RUNTIME_ERROR_1
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
catapult::Hash160_Size
constexpr size_t Hash160_Size
Definition: src/catapult/types.h:35
catapult::Address_Encoded_Size
constexpr size_t Address_Encoded_Size
Definition: src/catapult/types.h:60
Hashes.h
catapult::model::IsValidEncodedAddress
bool IsValidEncodedAddress(const std::string &encoded, NetworkIdentifier networkIdentifier)
Definition: Address.cpp:81
catapult::utils::ByteArray::begin
constexpr auto begin() const noexcept
Returns a const iterator to the first byte.
Definition: ByteArray.h:91
Address.h
catapult::utils::TryBase32Decode
bool TryBase32Decode(const RawString &encodedData, const MutableRawBuffer &data)
Definition: Base32.cpp:137
catapult::model::PublicKeyToAddress
Address PublicKeyToAddress(const Key &publicKey, NetworkIdentifier networkIdentifier)
Creates an address from a public key (publicKey) for the network identified by networkIdentifier.
Definition: Address.cpp:50
catapult::model::AddressToString
std::string AddressToString(const Address &address)
Creates an encoded address from an address.
Definition: Address.cpp:38
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
catapult::Address
utils::ByteArray< Address_Decoded_Size, Address_tag > Address
Definition: src/catapult/types.h:63
catapult::model::StringToAddress
Address StringToAddress(const std::string &str)
Creates an address from an encoded address (encoded).
Definition: Address.cpp:31
Base32.h
catapult::Address_Decoded_Size
constexpr size_t Address_Decoded_Size
Definition: src/catapult/types.h:59
types.h
Casting.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::utils::ByteArray< Address_Decoded_Size, Address_tag >
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
catapult::crypto::Keccak_256
void Keccak_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit Keccak hash of dataBuffer into hash.
Definition: Hashes.cpp:89
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
catapult::crypto::Ripemd160
void Ripemd160(const RawBuffer &dataBuffer, Hash160 &hash) noexcept
Calculates the ripemd160 hash of dataBuffer into hash.
Definition: Hashes.cpp:44