示例#1
0
文件: common.hpp 项目: BestSilent/eos
      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;
      }
示例#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);
}
示例#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 );
 }
示例#5
0
文件: pke.cpp 项目: BrownBear2/fc
 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() );
 }
示例#6
0
文件: pke.cpp 项目: BrownBear2/fc
 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() );
 }
示例#7
0
文件: pke.cpp 项目: BrownBear2/fc
 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()) );
 }