Skip to content

Instantly share code, notes, and snippets.

@iiviigames
Created September 29, 2023 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iiviigames/2dcf5b40cf92fa1edb6ee4262988fa52 to your computer and use it in GitHub Desktop.
Save iiviigames/2dcf5b40cf92fa1edb6ee4262988fa52 to your computer and use it in GitHub Desktop.
Python MD5 Checksum Printerx
# 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