logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

antigravity.py (500B)


  1. import webbrowser
  2. import hashlib
  3. webbrowser.open("https://xkcd.com/353/")
  4. def geohash(latitude, longitude, datedow):
  5. '''Compute geohash() using the Munroe algorithm.
  6. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
  7. 37.857713 -122.544543
  8. '''
  9. # https://xkcd.com/426/
  10. h = hashlib.md5(datedow, usedforsecurity=False).hexdigest()
  11. p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
  12. print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))