当前位置:网站首页>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))
边栏推荐
- . Net 7 Preview 1 has been officially released
- 【js】-【链表-应用】-学习笔记
- 常用正则表达式
- R language dplyr package group_ By function and summarize_ The at function calculates the dataframe to calculate the number of counts and the mean value of different groups (summary data by category v
- Basic data type
- 257. 关押罪犯
- 376. 机器任务
- Daily practice (22): maximum sum of continuous subarrays
- Jetpack Compose 最新进展
- Gocolly manual
猜你喜欢
Fibonacci
Helix distance of point
7-7 数字三角形
【js】-【栈、队-应用】-学习笔记
【UVM入门 ===> Episode_8 】~ Sequence 和 Sequencer、Sequence 层次化
Mousse shares listed on Shenzhen Stock Exchange: becoming popular by mattress and "foreign old man", with a market value of 22.4 billion yuan
Detailed explanation of online group chat and dating platform project (servlet implementation)
Record the range of data that MySQL update will lock
[JS] - [array application] - learning notes
Harmonyos accessing database instances (3) -- use ORM bee to test how good harmonyos is
随机推荐
OpenSSL SSL_read: Connection was reset, errno 10054
Websocket learning
Laravel message queue
F29oc analysis
MySQL 表的增删查改
Accounting standards for business enterprises application [5]
[JS] - [array, stack, queue, linked list basics] - Notes
File contains vulnerability issues
Blogs personal blog project details (servlet implementation)
二分查找数组下标
R language uses the aggregate function of epidisplay package to split numerical variables into different subsets based on factor variables, calculate the summary statistics of each subset, and customi
Laravel pagoda security configuration
Financial management [2]
7-6 铺设油井管道
R language dplyr package group_ By function and summarize_ The at function calculates the dataframe to calculate the number of counts and the mean value of different groups (summary data by category v
Websocket long link pressure test
Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
idea创建模块提示已存在
Financial management [3]
Ningde times will increase RMB 45billion: Hillhouse subscribes RMB 3billion and Zeng Yuqun still controls 23% of the equity