“提交项目”

This commit is contained in:
2026-03-03 14:43:13 +08:00
commit fba98b388c
492 changed files with 146765 additions and 0 deletions

18
get_machine_code.py Normal file
View File

@@ -0,0 +1,18 @@
import platform
import uuid
import hashlib
def get_machine_id() -> str:
"""生成机器码。
根据当前系统信息平台、架构、MAC地址生成唯一机器码
使用 SHA256 取前16位并转大写前缀为 HERTZ_STUDIO_。
"""
system_info = f"{platform.platform()}-{platform.machine()}-{uuid.getnode()}"
return 'HERTZ_STUDIO_' + hashlib.sha256(system_info.encode()).hexdigest()[:16].upper()
if __name__ == "__main__":
machine_code = get_machine_id()
print(f"您的机器码是: {machine_code}")