NFLmusic库文件
This commit is contained in:
25
nflmusic/obfuscation.py
Normal file
25
nflmusic/obfuscation.py
Normal file
@ -0,0 +1,25 @@
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
|
||||
def hash_filename(filename):
|
||||
hash_object = hashlib.sha256(filename.encode())
|
||||
hex_dig = hash_object.hexdigest()
|
||||
return hex_dig
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
hashed_files = {}
|
||||
|
||||
while True:
|
||||
string_input = input("请输入字符串(输入'退出'退出循环):")
|
||||
if string_input == "退出":
|
||||
break
|
||||
hashed_name = hash_filename(string_input)
|
||||
hashed_files[string_input] = hashed_name
|
||||
|
||||
json_filename = input("请输入要保存的 JSON 文件名:")
|
||||
with open(json_filename, 'w') as json_file:
|
||||
json.dump(hashed_files, json_file)
|
||||
|
||||
print(f"JSON 文件已保存为 {json_filename}")
|
Reference in New Issue
Block a user