def hash_string(string, loops): string_length = len(string) for _ in range(loops): string = format_and_encode(string) string = hashlib.md5(string).hexdigest() return string[:string_length]
def hash_caesar_cipher(string, loops): string_length = len(string) for _ in range(loops): ciphered = caesar_cipher(string, 4) string = format_and_encode(ciphered) string = hashlib.md5(string).hexdigest() return string[:string_length]
def hash_rot_13(string, loops): string_length = len(string) for _ in range(loops): translated = codecs.encode(string, 'rot_13') string = format_and_encode(translated) string = hashlib.md5(string).hexdigest() return string[:string_length]
def hash_string_in_half(string, loops): string_length = len(string) for _ in range(loops): string = format_and_encode(string) part1 = string[0:string_length // 2] part2 = string[string_length // 2 if string_length % 2 == 0 else ((string_length // 2) + 1):] string = hashlib.md5(part1).hexdigest() + hashlib.md5( part2).hexdigest() return string[:string_length]
def hash_string_by_four(string, loops): string_length = len(string) for _ in range(loops): splitted = split_every_n(string, 4) new_hash = '' for item in splitted: item = format_and_encode(item) new_hash += hashlib.md5(item).hexdigest() string = new_hash return string[:string_length]