Created
September 29, 2023 03:48
-
-
Save iiviigames/2dcf5b40cf92fa1edb6ee4262988fa52 to your computer and use it in GitHub Desktop.
Python MD5 Checksum Printerx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AUTHOR: iiviigames | |
# https://twitter.com/iiviigames | |
# EMAIL: iiviigames@pm.me | |
# DESC: Runs a tkinter window that opens a file and prints out a checksum. | |
# VALID SUM: e80a0456f071b8e8ba101e64907174a8 | |
# VERSION: 1.0 | |
# CREATED: 09/28/2023 | |
# UPDATED: 09/28/2023 | |
# SPEEDRUN: https://speedrun.com/Go_Forth | |
# NOTES: All you need to run this is python, found at https://python.org | |
# Double click the script, and a window will open, where you can click | |
# a button to locate the .swf file, and it will print! | |
# =============================================================================== | |
import tkinter as tk | |
from tkinter import filedialog | |
import hashlib | |
def calculate_md5(file_path): | |
md5 = hashlib.md5() | |
with open(file_path, 'rb') as file: | |
while True: | |
data = file.read(8192) | |
if not data: | |
break | |
md5.update(data) | |
return md5.hexdigest() | |
def process_file(): | |
file_path = filedialog.askopenfilename() | |
if file_path: | |
md5_hash = calculate_md5(file_path) | |
display_text = f"MD5 Checksum:\n{md5_hash}" | |
text_display.config(state=tk.NORMAL) | |
text_display.delete(1.0, tk.END) | |
text_display.insert(tk.END, display_text) | |
text_display.config(state=tk.DISABLED) | |
# Create the main application window | |
app = tk.Tk() | |
app.title('Text Extractor with MD5') | |
# Create a button to open a file dialog | |
open_button = tk.Button(app, text='Open File', command=process_file) | |
open_button.pack() | |
# Create a text widget to display the result | |
# Create a text widget to display the result with centered text | |
text_display = tk.Text(app, wrap=tk.WORD, height=4, width=40) | |
text_display.pack() | |
text_display.config(state=tk.DISABLED, font=("Helvetica", 25, "bold")) | |
text_display.tag_configure("center", justify="center") | |
text_display.insert(tk.INSERT, "MD5 Checksum:\n", "center") | |
text_display.insert(tk.INSERT, calculate_md5, "center") | |
# Start the tkinter main loop | |
app.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment