Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 01dd155

Browse files
committed
Adding Animations and Color
1 parent 9a1eff9 commit 01dd155

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

lu77U_SHA256/Custom_Print.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
import time
3+
4+
class CustomPrint:
5+
def __init__(self, text):
6+
self.text = text
7+
8+
def custom_print(text):
9+
for char in text:
10+
sys.stdout.write(char)
11+
sys.stdout.flush()
12+
time.sleep(0.1)
13+
print()

lu77U_SHA256/Main.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from lu77U_SHA256.Input_Padder import InputPadder
33
from lu77U_SHA256.Padded_Parser import InputParser
44
from lu77U_SHA256.Main_Class import MainClass
5+
from lu77U_SHA256.Custom_Print import CustomPrint
56

67
@click.command()
78
@click.option(
@@ -29,17 +30,20 @@ def main(text, text_from_file, file):
2930
with open(text_from_file, 'r') as f:
3031
input_string = f.read()
3132
else:
32-
click.echo("Please provide input using either --text or --text_from_file.")
33+
click.echo("Please provide input using either --text or --text_from_file")
3334
return
3435

3536
padded_input_string = InputPadder(input_string).pad_input()
36-
click.echo(f"Padded Input String: {padded_input_string}")
37+
custom_printer = CustomPrint(f"\033[33mPadded Input String: \033[0m\033[36m{padded_input_string}\033[0m")
38+
custom_printer.custom_print()
3739

3840
expanded_message_schedule = InputParser(padded_input_string).process_chunks()
39-
click.echo(f"Expanded Message Schedule: {expanded_message_schedule}")
41+
custom_printer.text = f"\033[33mExpanded Message Schedule: \033[0m\033[36m{expanded_message_schedule}\033[0m"
42+
custom_printer.custom_print()
4043

4144
hash_result = MainClass(expanded_message_schedule).hash_message()
42-
click.echo(f"The Hash Result: {hash_result}")
45+
custom_printer.text = f"\033[33mThe Hash Result: \033[0m\033[36m{hash_result}\033[0m"
46+
custom_printer.custom_print()
4347

4448
if __name__ == '__main__':
4549
main()

0 commit comments

Comments
 (0)