Beispiel #1
0
      std::string operator()( const KeyType& key ) const {
         using data_type = typename KeyType::data_type;
         constexpr int position = Storage::template position<KeyType>();
         constexpr bool is_default = position == DefaultPosition;

         checksummed_data<data_type> wrapper;
         wrapper.data = key.serialize();
         wrapper.check = checksummed_data<data_type>::calculate_checksum(wrapper.data, !is_default ? Prefixes[position] : nullptr);
         auto packed = raw::pack( wrapper );
         auto data_str = to_base58( packed.data(), packed.size() );
         if (!is_default) {
            data_str = string(Prefixes[position]) + "_" + data_str;
         }

         return data_str;
      }
Beispiel #2
0
char *p2sh_to_base58(const tal_t *ctx, bool test_net,
		     const struct ripemd160 *p2sh)
{
	return to_base58(ctx, test_net ? 196 : 5, p2sh);
}
Beispiel #3
0
char *bitcoin_to_base58(const tal_t *ctx, bool test_net,
			const struct bitcoin_address *addr)
{
	return to_base58(ctx, test_net ? 111 : 0, &addr->addr);
}
 std::string public_key::to_base58() const
 {
   public_key_data key = serialize();
   return to_base58( key );
 }
Beispiel #5
0
 void pack( fc::value& v, const fc::signature_t& s ) {
     fc::vector<char> ve = fc::raw::pack( s );
     v = to_base58( ve.data(), ve.size() );
 }
Beispiel #6
0
 void pack( fc::value& v, const fc::private_key_t& s ) {
     fc::vector<char> ve = fc::raw::pack( s );
     v = to_base58( ve.data(), ve.size() );
 }
Beispiel #7
0
 void pack( fc::value& v, const fc::public_key_t& s ) {
     fc::vector<char> ve = fc::raw::pack( s );
     v = to_base58( ve.data(), size_t(ve.size()) );
 }