MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / mod

Function mod

projects/hill_cipher/decryption.py:9–14  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

7
8# to perform the modulus operation
9def mod(num):
10 if num < 0:
11 result = 26 - (abs(num) % 26)
12 else:
13 result = num % 26
14 return result
15
16
17def hill_cipher(text, key_matrix):

Callers 1

messageFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected