简体   繁体   English

在 python 中将十六进制表示为 64 字节(64 个字符)

[英]Represent hex to 64 byte (64 characters) in python

The results in "hex" are required to be completed with zeros. “十六进制”中的结果需要以零完成。

example h = ed23 be represented like this 000000000000000000000000000000000000000000000000000000000000ed23例如 h = ed23 表示为 000000000000000000000000000000000000000000000000000000000000ed23

solved with zfill()用 zfill() 解决

hex = ed23
hex64character = hex.zfill(64)
print(hex64character)
>>>000000000000000000000000000000000000000000000000000000000000ed23

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM