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

Commit 29c564d

Browse files
committed
Few Animation Issue and Proper Printing
1 parent 166dfd3 commit 29c564d

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

lu77U_SHA256/Custom_Print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def custom_print(self):
99
for char in self.text:
1010
sys.stdout.write(char)
1111
sys.stdout.flush()
12-
time.sleep(0.075)
12+
time.sleep(0.05)
1313
print()

lu77U_SHA256/Main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ def main(text, text_from_file, file, animation, debug):
4444
click.echo("Please provide input using either --text or --text_from_file")
4545
return
4646

47+
if animation:
48+
custom_printer = CustomPrint("")
49+
4750
padded_input_string = InputPadder(input_string).pad_input()
4851
if debug:
4952
if animation:
50-
custom_printer = CustomPrint(f"\n\033[33mPadded Input String: \033[0m\033[36m{padded_input_string}\033[0m")
53+
custom_printer.text = f"\n\033[33mPadded Input String: \033[0m\033[36m{padded_input_string}\033[0m"
5154
custom_printer.custom_print()
5255
else:
5356
click.echo(f"\n\033[33mPadded Input String: \033[0m\033[36m{padded_input_string}\033[0m")
@@ -56,18 +59,18 @@ def main(text, text_from_file, file, animation, debug):
5659

5760
if debug:
5861
if animation:
59-
custom_printer.text = f"\n\033[33mExpanded Message Schedule: \033[0m\033[36m{expanded_message_schedule}\033[0m"
62+
custom_printer.text = f"\n\033[33mExpanded Message Schedule: \033[0m\033[36m{expanded_message_schedule}\033[0m\n"
6063
custom_printer.custom_print()
6164
else:
62-
click.echo(f"\n\033[33mExpanded Message Schedule: \033[0m\033[36m{expanded_message_schedule}\033[0m")
65+
click.echo(f"\n\033[33mExpanded Message Schedule: \033[0m\033[36m{expanded_message_schedule}\033[0m\n")
6366

6467
hash_result = MainClass(expanded_message_schedule).hash_message()
6568

6669
if animation:
67-
custom_printer.text = f"\n\033[33mThe Hash Result: \033[0m\033[36m{hash_result}\033[0m"
70+
custom_printer.text = f"\033[33mThe SHA-256 Hash of {input_string}: \033[0m\033[36m{hash_result}\033[0m"
6871
custom_printer.custom_print()
6972
else:
70-
click.echo(f"\n\033[33mThe Hash Result: \033[0m\033[36m{hash_result}\033[0m")
73+
click.echo(f"\033[33mThe SHA-256 Hash of {input_string}: \033[0m\033[36m{hash_result}\033[0m")
7174

7275
if __name__ == '__main__':
7376
main()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="lu77U-SHA256",
5-
version="1.1.5",
5+
version="1.1.6",
66
author="Sam MG Harish",
77
home_page="https://github.com/sam-mg/Python-SHA-256-Implementation",
88
license="Apache Software License 2.0",

0 commit comments

Comments
 (0)