diff --git a/keyhunt.cpp b/keyhunt.cpp index a9a66e1..0316c2b 100644 --- a/keyhunt.cpp +++ b/keyhunt.cpp @@ -2195,15 +2195,25 @@ int main(int argc, char **argv) { pretotal.Div(&seconds); str_seconds = seconds.GetBase10(); str_pretotal = pretotal.GetBase10(); - str_total = total.GetBase10(); - - + str_total = total.GetBase10('_'); + char str_range_ratio[2048]; + if (!total.IsZero()) { + Int range_ratio; + range_ratio.Sub(&n_range_end, &n_range_start); + range_ratio.Div(&total, 0); + sprintf(str_range_ratio, ", 1:%s ", range_ratio.GetBase10('_')); + } + else { + str_range_ratio[0] = 0; + } + + if(pretotal.IsLower(&int_limits[0])) { if(FLAGMATRIX) { - sprintf(buffer,"[+] Total %s keys in %s seconds: %s keys/s\n",str_total,str_seconds,str_pretotal); + sprintf(buffer,"[+] Total %s keys in %s seconds: %s keys/s%s\n",str_total,str_seconds,str_pretotal,str_range_ratio); } else { - sprintf(buffer,"\r[+] Total %s keys in %s seconds: %s keys/s\r",str_total,str_seconds,str_pretotal); + sprintf(buffer,"\r[+] Total %s keys in %s seconds: %s keys/s%s\r",str_total,str_seconds,str_pretotal,str_range_ratio); } } else { @@ -2222,14 +2232,14 @@ int main(int argc, char **argv) { div_pretotal.Div(&int_limits[salir ? i : i-1]); str_divpretotal = div_pretotal.GetBase10(); if(FLAGMATRIX) { - sprintf(buffer,"[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)\n",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal); + sprintf(buffer,"[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)%s\n",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal,str_range_ratio); } else { if(THREADOUTPUT == 1) { - sprintf(buffer,"\r[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)\r",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal); + sprintf(buffer,"\r[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)%s\r",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal,str_range_ratio); } else { - sprintf(buffer,"\r[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)\r",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal); + sprintf(buffer,"\r[+] Total %s keys in %s seconds: ~%s %s (%s keys/s)%s\r",str_total,str_seconds,str_divpretotal,str_limits_prefixs[salir ? i : i-1],str_pretotal,str_range_ratio); } } free(str_divpretotal); @@ -5819,11 +5829,11 @@ void writevanitykey(bool compressed,Int *key) { #endif keys = fopen("VANITYKEYFOUND.txt","a+"); if(keys != NULL) { - fprintf(keys,"Vanity Private Key: %s\npubkey: %s\nAddress %s\nrmd160 %s\n",hextemp,public_key_hex,address,hexrmd); + fprintf(keys,"Vanity Private Key: %s\npubkey: %s\nAddress %s\nrmd160 %s\n\n",hextemp,public_key_hex,address,hexrmd); fclose(keys); } - printf("\nVanity Private Key: %s\npubkey: %s\nAddress %s\nrmd160 %s\n",hextemp,public_key_hex,address,hexrmd); - + printf("\nVanity Private Key: %s\npubkey: %s\nAddress %s\nrmd160 %s\n\n",hextemp,public_key_hex,address,hexrmd); + #if defined(_WIN64) && !defined(__CYGWIN__) ReleaseMutex(write_keys); #else diff --git a/secp256k1/Int.cpp b/secp256k1/Int.cpp index 3fca105..404f2be 100644 --- a/secp256k1/Int.cpp +++ b/secp256k1/Int.cpp @@ -942,8 +942,8 @@ void Int::SetBase16(const char *value) { // ------------------------------------------------ -char* Int::GetBase10() { - return GetBaseN(10,"0123456789"); +char* Int::GetBase10(char thousand_separator) { + return GetBaseN(10,"0123456789",thousand_separator); } // ------------------------------------------------ @@ -1014,7 +1014,7 @@ void Int::SetBaseN(int n,const char *charset,const char *value) { // ------------------------------------------------ -char* Int::GetBaseN(int n,const char *charset) { +char* Int::GetBaseN(int n,const char *charset,char thousand_separator) { char *ret = (char*) calloc(1,1024); Int N(this); @@ -1044,8 +1044,11 @@ char* Int::GetBaseN(int n,const char *charset) { if (isNegative) ret[offset++] = '-'; - for (int i = 0; i < digitslen; i++) + for (int i = 0; i < digitslen; i++) { + if (thousand_separator && (i > 0) && (i % 3 == digitslen % 3)) + ret[offset++] = thousand_separator; ret[offset++] = charset[digits[digitslen - 1 - i]]; + } if (offset == 0) ret[offset] = '0'; diff --git a/secp256k1/Int.h b/secp256k1/Int.h index b0ffb89..2018fd6 100644 --- a/secp256k1/Int.h +++ b/secp256k1/Int.h @@ -159,9 +159,9 @@ class Int { void Get32Bytes(unsigned char *buff); char* GetBase2(); - char* GetBase10(); + char* GetBase10(char thousand_separator = 0); char* GetBase16(); - char* GetBaseN(int n,const char *charset); + char* GetBaseN(int n,const char *charset,char thousand_separator = 0); char* GetBlockStr(); char* GetC64Str(int nbDigit);