I have written a python script to mine bitcoin.
I am however getting only 3k to 300k hashes per second
Here is the code:
import time
import hashlib
import random
import string
size_of_rand_input = int(input("Size of each random string: "))
def id_generator(chars=string.ascii_letters + string.digits):
return ''.join(random.choice(chars) for _ in range(size_of_rand_input))
def CheckSpeed(number_of_hashes):
t1 = time.time()
for x in range(number_of_hashes):
hashed = hashlib.sha256(str(id_generator()).encode("utf-8"))
t2 = time.time()
time_allotted= t2-t1
returned = (time_allotted, number_of_hashes)
return returned;
hashes = int(input("How many hashes would you like to perform: "))
x = CheckSpeed(hashes)
print("It took {} seconds to perform {} hashes!\n".format(x[0], x[1]))