daily pastebin goal
56%
SHARE
TWEET

ab

a guest Jun 13th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("type in the text you want to hash")
  2. st = input('text: ')
  3. y = (' '.join(format(ord(x), 'b') for x in st))
  4. def numDigits(y):
  5.     y_str = str(y)
  6.     return len(y_str)
  7. print("text2bin number lenght: ", numDigits(y) + 1)
  8. z = (64 % (numDigits(y) + 1))
  9. if  z != 0:
  10.     print("we need to add" , z , "piece 0s to the bin text end")
  11.     a = st.ljust(len(st) + z , '0')
  12.     print(a)
  13. else:
  14.     print("ok")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top