鸿鹄论坛

 找回密码
 论坛注册

QQ登录

QQ不能直接注册帐号

查看: 80|回复: 1

[分享] 简单地将IP地址转换为十六进制

[复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式
本帖最后由 thegreek1 于 2019-9-10 12:03 编辑

记住这张桌子
0 = 0
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
10 = A.
11 = B.
12 = C.
13 = D.
14 = E.
15 = F.
192 = C0 = (192/16) = 12.0 = take the remainder (0 x 16) = 0 to convert it to hexadecimal (0)
Then take the result (12) divided by 16 (12/16), if it is less than 1, then
Convert the remainder to hex 12 = C and then add it back to C0

168 = A8 = (168/16) = 10.8 = remainder (.8 x 16) = 12.8 converts it to hexadecimal (A) and then
Take the result (12) divided by 16 (12/16), if it is less than 1, then just cover
The remainder is hexadecimal 0 = 0 and then add 0A8 or A8 backwards

42 = 2A = (42/16) = 2.625 = remainder (.625 x 16) = 10 converts it to hexadecimal (A) and then
Take the result (2) divided by 16 (2/16), if it is less than 1, then just hide it
The remainder is hexadecimal 2 = 2 and then added back to 2A



如果觉得帖子内容对你有帮助,请点击【评分】给我增加好评度,加分不会扣除自己的积分。

您所在的用户组无法发言?请去这里做下邮箱验证

发考试战报,来这里申请勋章,菜鸟变高手从此走上人生巅峰
发表于 5 天前 | 显示全部楼层


Thanks for sharing  !!!

如果觉得帖子内容对你有帮助,请点击【评分】给我增加好评度,加分不会扣除自己的积分。

您所在的用户组无法发言?请去这里做下邮箱验证

发考试战报,来这里申请勋章,菜鸟变高手从此走上人生巅峰
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )

GMT+8, 2019-9-15 18:41 , Processed in 0.071286 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz!

© 2001-2019 HH010.COM

快速回复 返回顶部 返回列表