Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server_seed = input("Paste server seed here: ")
- block_hash = input("\nPaste block hash here: ")
- total_tickets = input("\nWhat is the total number of tickets? ")
- string1 = server_seed + ":" + block_hash + ":1"
- import hashlib
- string1_sha256 = hashlib.sha256(string1.encode('utf-8')).hexdigest()
- string2 = string1_sha256[:8]
- num1 = int(string2, 16) #convert string2 to decimal
- num2 = num1 * (int(total_tickets) - 1) / 4294967295
- winning_ticket = num2 + 0.5
- print("Winning ticket number is: " + str(int(winning_ticket)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement