<commit_before>#include <fc/crypto/ripemd160.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/crypto/base58.hpp>
#include <fc/io/varint.hpp>
#include <fc/exception/exception.hpp>
#include <fc/io/raw.hpp>

#include <bts/blockchain/types.hpp>
#include <bts/blockchain/config.hpp>
#include <bts/blockchain/address.hpp>

//TODO tmp debug
#include <iostream>


namespace bts { namespace blockchain {

    using std::string;   
 
    public_key_type::public_key_type():key_data(){};

    public_key_type::public_key_type( const fc::ecc::public_key_data& data )
        :key_data( data ) {};

    public_key_type::public_key_type( const fc::ecc::public_key& pubkey )
        :key_data( pubkey ) {};

    public_key_type::public_key_type( const std::string& base58str )
    {
       static const size_t prefix_len = strlen(BTS_ADDRESS_PREFIX);
       FC_ASSERT( base58str.size() > prefix_len );
       std::cout << base58str.substr(0, prefix_len) << "\n";
       FC_ASSERT( base58str.substr( 0, prefix_len ) == BTS_ADDRESS_PREFIX, "", ("base58str", base58str) );
       auto bin = fc::from_base58( base58str.substr( prefix_len ) );
       auto bin_key = fc::raw::unpack<binary_key>(bin);
       key_data = bin_key.data;
       FC_ASSERT( fc::ripemd160::hash( key_data.data, key_data.size() )._hash[0] == bin_key.check );
    };

    public_key_type::operator fc::ecc::public_key_data() const
    {
       return key_data;    
    };
    public_key_type::operator fc::ecc::public_key() const
    {
       return fc::ecc::public_key( key_data );
    };

    public_key_type::operator std::string() const
    {
       binary_key k;
       k.data = key_data;
       k.check = fc::ripemd160::hash( k.data.data, k.data.size() )._hash[0];
       auto data = fc::raw::pack( k );
       return BTS_ADDRESS_PREFIX + fc::to_base58( data.data(), data.size() );<commit_msg>remove debug output<commit_after>#include <fc/crypto/ripemd160.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/crypto/base58.hpp>
#include <fc/io/varint.hpp>
#include <fc/exception/exception.hpp>
#include <fc/io/raw.hpp>

#include <bts/blockchain/types.hpp>
#include <bts/blockchain/config.hpp>
#include <bts/blockchain/address.hpp>


namespace bts { namespace blockchain {

    using std::string;   
 
    public_key_type::public_key_type():key_data(){};

    public_key_type::public_key_type( const fc::ecc::public_key_data& data )
        :key_data( data ) {};

    public_key_type::public_key_type( const fc::ecc::public_key& pubkey )
        :key_data( pubkey ) {};

    public_key_type::public_key_type( const std::string& base58str )
    {
       static const size_t prefix_len = strlen(BTS_ADDRESS_PREFIX);
       FC_ASSERT( base58str.size() > prefix_len );
       FC_ASSERT( base58str.substr( 0, prefix_len ) == BTS_ADDRESS_PREFIX, "", ("base58str", base58str) );
       auto bin = fc::from_base58( base58str.substr( prefix_len ) );
       auto bin_key = fc::raw::unpack<binary_key>(bin);
       key_data = bin_key.data;
       FC_ASSERT( fc::ripemd160::hash( key_data.data, key_data.size() )._hash[0] == bin_key.check );
    };

    public_key_type::operator fc::ecc::public_key_data() const
    {
       return key_data;    
    };
    public_key_type::operator fc::ecc::public_key() const
    {
       return fc::ecc::public_key( key_data );
    };

    public_key_type::operator std::string() const
    {
       binary_key k;
       k.data = key_data;
       k.check = fc::ripemd160::hash( k.data.data, k.data.size() )._hash[0];
       auto data = fc::raw::pack( k );
       return BTS_ADDRESS_PREFIX + fc::to_base58( data.data(), data.size() );
{'fraction_non_alphanumeric': 0.15123030135471385, 'fraction_numerical': 0.017417749516173624, 'mean_word_length': 3.6503856041131106, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '946319', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1302, 'n_words': 219}