1 Star 0 Fork 0

RISCV-MCU/qemu

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qemu-stamp.py 614 Bytes
一键复制 编辑 原始数据 按行查看 历史
#! /usr/bin/env python3
# Usage: scripts/qemu-stamp.py STRING1 STRING2... -- FILE1 FILE2...
import hashlib
import os
import sys
sha = hashlib.sha1()
is_file = False
for arg in sys.argv[1:]:
if arg == '--':
is_file = True
continue
if is_file:
with open(arg, 'rb') as f:
for chunk in iter(lambda: f.read(65536), b''):
sha.update(chunk)
else:
sha.update(os.fsencode(arg))
sha.update(b'\n')
# The hash can start with a digit, which the compiler doesn't
# like as an symbol. So prefix it with an underscore
print("_" + sha.hexdigest())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/riscv-mcu/qemu.git
git@gitee.com:riscv-mcu/qemu.git
riscv-mcu
qemu
qemu
master

搜索帮助