当前位置:网站首页>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))
边栏推荐
猜你喜欢

Harmonyos accessing database instances (3) -- use ORM bee to test how good harmonyos is

记录一下MySql update会锁定哪些范围的数据

Installation and deployment of ganglia

点的螺旋距离

Idea creation module prompt already exists

【js】-【树】-学习笔记

Pseudo original intelligent rewriting API Baidu - good collection

慕思股份深交所上市:靠床垫和“洋老头”走红 市值224亿

Super detailed cookie addition, deletion, modification and query
![[introduction to UVM== > episode_8] ~ sequence and sequencer, sequence hierarchy](/img/d0/7d78b00e4f6ad1e8efb73a5d472b09.png)
[introduction to UVM== > episode_8] ~ sequence and sequencer, sequence hierarchy
随机推荐
Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
From client to server
HarmonyOS访问数据库实例(3)--用ORM Bee测下HarmonyOS到底有多牛
idea创建模块提示已存在
[JS] - [linked list - application] - learning notes
Pseudo original intelligent rewriting API Baidu - good collection
Whereabouts computer desktop small arrow
企业数据防泄露解决方案分享
How should we measure agile R & D projects?
SimpleDateFormat 格式化和解析日期的具体类
7-2 求解买股票问题
R语言使用MatchIt包进行倾向性匹配分析、使用match.data函数构建匹配后的样本集合、对匹配后的样本的不同分组对应的目标变量的均值进行Welch双样本t检验分析、双独立样本t检验
22map introduction and API
Listen to the markdown file and hot update next JS page
golang map clear
379. 捉迷藏
数字IC设计经验整理(二)
Still using simpledateformat for time formatting? Be careful of project collapse
Selection (025) - what is the output of the following code?
How to add Google maps to a project