Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import hashlib
  2. from decimal import *
  3.  
  4.  
  5. def digest(number):
  6.     number = bytearray('{}'.format(number), encoding='utf-8')
  7.     h = hashlib.md5(number)
  8.     return h.hexdigest()
  9.  
  10.  
  11. def main():
  12.     file = open('file.txt', 'a')
  13.     range = Decimal('0.00001')
  14.     min = Decimal('0.00000')
  15.     max = Decimal('0.99999')
  16.     while min != max:
  17.         file.write('{0}:{1}\n'.format(min, digest('{0:.5f}'.format(min))))
  18.         min += range
  19.     file.close()
  20.  
  21. if __name__ == "__main__":
  22.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement