from random import choice, choices, Random from string import ascii_lowercase from zlib import crc32 def nonsense_consistent(domain): rng = Random(crc32(domain.encode("utf-8"))) length = rng.choices((9, 10, 11, 12), (4, 5, 3, 2))[0] return "".join(rng.choice(ascii_lowercase) for i in range(length))