Advertisement
Guest User

Retweet selection

a guest
Apr 20th, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import binascii
  2. import struct
  3. from math import floor
  4.  
  5. a = "0000000000000000000397eb2452c0ffe2c5ca847b222be9db48bcf3066da0dc" # Block hash, tested with block 519187
  6. d = binascii.unhexlify(a)
  7.  
  8. # Captured image size
  9. w = 1080
  10. h = 12249
  11. ilen = w * h
  12.  
  13. s, t, u, v = struct.unpack("QQQQ", d)
  14.  
  15. p = (s + t + u + v)
  16.  
  17. y = floor((p / h) % ilen / w)
  18.  
  19. print(y) # Nearest retweet on this Y position from, in this example pimpingkek would win
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement