Advertisement
Guest User

lambo_lottery_verification

a guest
Apr 8th, 2020
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. server_seed = input("Paste server seed here: ")
  2. block_hash = input("\nPaste block hash here: ")
  3. total_tickets = input("\nWhat is the total number of tickets? ")
  4.  
  5. string1 = server_seed + ":" + block_hash + ":1"
  6.  
  7. import hashlib
  8.  
  9. string1_sha256 = hashlib.sha256(string1.encode('utf-8')).hexdigest()
  10. string2 = string1_sha256[:8]
  11. num1 = int(string2, 16) #convert string2 to decimal
  12. num2 = num1 * (int(total_tickets) - 1) / 4294967295
  13. winning_ticket = num2 + 0.5
  14.  
  15. print("Winning ticket number is: " + str(int(winning_ticket)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement