Convert a hashcode to its binary representation

963 Views Asked by At

I compute the hash code for the word "tropical" using the Adler32 algorithm. The result is the number "260768607" How can I convert the above number to its binary representation? Thank you

1

There are 1 best solutions below

7
phantom On BEST ANSWER

You can do this via the bin() builtin function.

So for your number this would look like this:

bin(260768607) # Result: '0b1111100010110000001101011111'

Hope this helped, good luck!

Edit: If you need too remove the 0b part, you can use this code:

int(str(temp)[2:])