#include "socketio.hpp" #include "BigInt64.hpp" #include #include #include unsigned long long nanoTime(){ using namespace std; using namespace std::chrono; return duration_cast(high_resolution_clock::now().time_since_epoch()).count(); } template std::ostream& operator<<(std::ostream& out, std::vector o){ out << "["; for(unsigned int i = 0;i < o.size();i++){ if(o[i] == '\r')continue; out << o[i]; if(i < o.size() - 1) out << ", "; } return out << "]"; } template<> std::ostream& operator<< (std::ostream& out, std::vector o){ for(unsigned int i = 0;i < o.size();i++){ out << o[i]; } return out; } int main(){ xoshiro_256 gen(1); BigInt a(256); BigInt b(8); a.moda(b); std::cout << a.toString() << "\n"; } /*int mian(){ cppsocket sock("192.168.178.79", 80); //cppsocket sock("127.0.0.1", 80); std::vector toSend(10); for(unsigned int i = 0;i < toSend.size();i++){ toSend[i] = (char)(i * i) % 10 + 'a'; } //std::cout << errno << std::endl; try{ for(int i = 0;i < 100;i++){ sock.write(toSend); std::cout << "Rec" << std::endl; std::cout << sock.receive() << std::endl; //std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } catch(std::exception& e){ std::cout << e.what() << std::endl; } //std::cout << "Sent " << std::to_string(toSend.size()) << ", Receiving..." << std::endl; //sock.write(std::vector(1,1)); //std::vector vec = sock.receive(); //std::cout << (vec == toSend); //std::cout << vec << std::endl; //vec = sock.receive(); //std::cout << vec << std::endl; return 0; }*/