Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

python 通过proto decode 解析处理的16进制 如何转字符串

 32: ""
      38 {
        15: 0x3939333332326a78
      }
      46: "MS4wLjABAAAAVeFY61lZRhnm3SfHyvdG6I0IhOpDNBhi8Kq-GVdMpsKzc9E1E4kzcSf-5d3oGW3-"

反序列化后的 0x3939333332326a78 这个怎么转换字符串汉字呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

字符串是 “xj223399” 吗

In [1]: n = 0x3939333332326a78                                               
In [2]: from struct import pack 

In [3]: pack('<Q', n).decode()                                               
Out[3]: 'xj223399'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...