Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("type in the text you want to hash")
- st = input('text: ')
- y = (' '.join(format(ord(x), 'b') for x in st))
- def numDigits(y):
- y_str = str(y)
- return len(y_str)
- print("text2bin number lenght: ", numDigits(y) + 1)
- z = (64 % (numDigits(y) + 1))
- if z != 0:
- print("we need to add" , z , "piece 0s to the bin text end")
- a = st.ljust(len(st) + z , '0')
- print(a)
- else:
- print("ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement