BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
31 namespace graphene {
namespace protocol {
38 std::vector<char> v =
fc::from_base58( base58str.substr( prefix.size() ) );
39 memcpy( (
char*)
addr.
_hash, v.data(), std::min<size_t>( v.size()-4,
sizeof(
addr ) ) );
44 const size_t prefix_len = prefix.size();
45 if( base58str.size() <= prefix_len )
47 if( base58str.substr( 0, prefix_len ) != prefix )
54 catch(
const fc::parse_error_exception& e )
63 if( memcmp( v.data() + 20, (
char*)checksum.
_hash, 4 ) != 0 )
90 address::operator std::string()
const
93 static_assert(
sizeof(bin_addr) >=
sizeof(addr) + 4,
"address size mismatch" );
94 memcpy( bin_addr, addr.data(),
sizeof(addr) );
96 memcpy( bin_addr +
sizeof(addr), (
char*)&checksum._hash[0], 4 );
106 vo = std::string(var);
std::string to_base58(const char *d, size_t s)
fc::ecc::public_key_data key_data
std::vector< char > from_base58(const std::string &base58_str)
std::string as_string() const
contains only the public point of an elliptic curve key.
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
boost::endian::little_uint32_buf_t _hash[5]
static sha512 hash(const char *d, uint32_t dlen)
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
address(const std::string &base58str)
converts to binary, validates checksum
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
#define GRAPHENE_ADDRESS_PREFIX
static ripemd160 hash(const fc::sha512 &h)
static bool is_valid(const std::string &base58str, const std::string &prefix=GRAPHENE_ADDRESS_PREFIX)
a 160 bit hash of a public key
public_key_data serialize() const