In Python, I have been able to take in a string of 32 bits, and convert this into a binary number with the following code:
def doConvert(string):
binary = 0
for letter in string:
binary <<= 8
binary += ord(letter)
return binary
So for the string, 'abcd', this method will return the correct value of 1633837924, however I cannot figure out how to do the opposite; take in a 32 bit binary number and convert this to a string.
If someone could help, I would appreciate the help!