- 12
- 0
- 约8.16千字
- 约 5页
- 2017-03-28 发布于湖北
- 举报
Lua小程序 十六进制字符串和二进制数据间的转换
从十六进制字符串转为二进制数:
1 #! /usr/local/bin/lua 2 3 4 --Note: Input hex string files content must be 5 --a upper case hex string 6 7 --Check the arguments 8 if #arg ~= 2 then 9 print(Usage:hexstr2bytes.lua Input Hex String File Output Bytes File\n);10 os.exit();11 end12 13 --Open input hex string file14 local hexstrfile = io.open(arg[1], rb);15 if nil == hexstrfile then16 print(Can not open input file!\n);17 os.exit();18 end19 20 --Read from the hex string file21 local hexstr = hexstrfile:read(*a);22 if nil == hexstr then23 print
您可能关注的文档
最近下载
- 铁路运输企业碳排放核算标准.pdf VIP
- 中国成人失眠诊断与治疗指南.ppt VIP
- 《计算机网络实验教程—基于Packet Tracer》全套教学课件.pptx
- 2025年人教版高中一年级水的电离(促进抑制)试卷及解析.docx VIP
- 细胞生物学期末考试复习题及答案详解.doc VIP
- 《人体解剖生理学》课件——第八章 泌尿与生殖系统.pptx VIP
- 建设工程项目管理存在问题及对策.doc VIP
- 2026健康医疗大数据赋能商业保险应用研究报告.pptx VIP
- 22D701-3电缆桥架安装(26.9MB)(26.85MB)5ce2e72e69780631(1).pdf VIP
- 中电联电气企业中级培训师-安全考试题库.docx VIP
原创力文档

文档评论(0)