MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / get_random_key

Function get_random_key

ciphers/affine_cipher.py:77–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75
76
77def get_random_key() -> int:
78 while True:
79 key_b = random.randint(2, len(SYMBOLS))
80 key_b = random.randint(2, len(SYMBOLS))
81 if gcd_by_iterative(key_b, len(SYMBOLS)) == 1 and key_b % len(SYMBOLS) != 0:
82 return key_b * len(SYMBOLS) + key_b
83
84
85def main() -> None:

Callers

nothing calls this directly

Calls 1

gcd_by_iterativeFunction · 0.90

Tested by

no test coverage detected