Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 Adler32 算法计算“热带”这个词的哈希码。结果是数字“260768607”如何将上述数字转换为其二进制表示?谢谢
您可以通过bin()内置函数执行此操作。
bin()
因此,对于您的号码,这将如下所示:
bin(260768607) # Result: '0b1111100010110000001101011111'
希望这有帮助,祝你好运!
编辑:如果您需要删除该0b部分,您可以使用以下代码:
0b
int(str(temp)[2:])