From 6528b2401ee5166155f093caa0717af6e0e15274 Mon Sep 17 00:00:00 2001 From: kalzu Date: Thu, 25 May 2023 22:41:28 +0300 Subject: [PATCH] cha cha cha.. ei ku shashasha... --- shashasha.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 shashasha.py diff --git a/shashasha.py b/shashasha.py new file mode 100755 index 0000000..5a84cb2 --- /dev/null +++ b/shashasha.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3.10 + +from hashlib import sha256 +from random import randint + +runs = 400 +turn = 0 +start = "Hello There, friend!" + +def turns_and_runs(turn, input, end): + input_bytes = input.encode() + input_hash = sha256(input_bytes) + return_blob = input_hash.hexdigest() + + if turn < runs: + my_random = randint(10, 60) + end += return_blob[my_random] + return_blob = return_blob + return_blob + str(my_random) + end = turns_and_runs(turn + 1, return_blob, end) + + return end + +result = turns_and_runs(turn, start, '') + +print(result)