16进制转回去就行,问ai要了个py代码帮忙转
def fourcc_to_string(fourcc_hex):
# 去掉$符号,将十六进制转换为整数
hex_val = int(fourcc_hex.replace('$', ''), 16)
# 将32位整数转换为4个字节(大端序)
return hex_val.to_bytes(4, 'big').decode('ascii', errors='ignore').strip('\x00')
# 你的示例
item_id = "$73686377"
skill_id = "$414E6874"
print(f"物品ID: {fourcc_to_string(item_id)}") # 输出: shcw
print(f"技能ID: {fourcc_to_string(skill_id)}") # 输出: ANht