当前位置:网站首页>libnum库简单使用(进制字符串转换)
libnum库简单使用(进制字符串转换)
2022-06-24 19:44:00 【雪月三十】
import libnum
#字符串转十进制
s="flag{123}"
print(libnum.s2n(s))
#十进制转字符串
j=1889377532526015427453
print(libnum.n2s(j))
#十六进制转字符串
n=0x666c61677b3132337d
print(libnum.n2s(n))
#字符串转十六进制
print(hex(libnum.s2n("flag{123}")))
#二进制转字符串
b='01100001011000110110001001100100'
print(libnum.b2s(b))
#字符串转二进制
s = 'acbd'
print(libnum.s2b(s))
#数字转二进制串
# n=0xfff
# print(s2b(n2s(n)))
#因数分解:返回n的所有素因子及每个素因子的个数。
print(libnum.factorize(1024))
#任意进制转为十进制
print(int('01111',2))
print(int('0x64',16))
边栏推荐
- 【js】-【字符串-应用】- 学习笔记
- Websocket learning
- 【js】-【链表-应用】-学习笔记
- Docker-mysql8-master-slave
- . Net 7 Preview 1 has been officially released
- golang convert json string to map
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses exp function, confint function and coef function to obtain the confidence
- 7-9 寻宝路线
- 选择类排序法
- No main manifest attribute in jar
猜你喜欢
随机推荐
【js】-【链表-应用】-学习笔记
R语言使用MatchIt包进行倾向性匹配分析、使用match.data函数构建匹配后的样本集合、通过双样本t检验分析(双独立样本t检验)来判断倾向性评分匹配后样本中的所有协变量的平衡情况
[JS] - [array, Stack, queue, Link List basis] - Notes
SimpleDateFormat 格式化和解析日期的具体类
冒泡排序
Helix distance of point
The R language uses the matchit package for propensity matching analysis and match The data function constructs the matched sample set, and performs Welch double sample t-test analysis and double inde
Whereabouts computer desktop small arrow
File contains vulnerability issues
[basic knowledge] ~ half adder & full adder
Main cause of EMI - mold current
【js】-【树】-学习笔记
慕思股份深交所上市:靠床垫和“洋老头”走红 市值224亿
7-3 最大子段和
文件包含漏洞问题
二分查找数组下标
华为机器学习服务语音识别功能,让应用绘“声”绘色
Paddledtx v1.0 has been released, and its security and flexibility have been comprehensively improved!
No main manifest attribute in jar
379. hide and seek








