mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-06-19 04:19:11 -04:00
some math scripts
This commit is contained in:
parent
9dc0d638a4
commit
ab54dc8e70
4 changed files with 151 additions and 0 deletions
26
Cryptography/tools/finding_gcd.py
Executable file
26
Cryptography/tools/finding_gcd.py
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
|
||||
def finding_gcd(a, b):
|
||||
''' implements the greatest common divider algorithm '''
|
||||
while(b != 0):
|
||||
result = b
|
||||
a, b = b, a % b
|
||||
return result
|
||||
|
||||
|
||||
def test_finding_gcd():
|
||||
number1 = 21
|
||||
number2 = 12
|
||||
assert(finding_gcd(number1, number2) == 3)
|
||||
print('Tests passed!')
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_finding_gcd()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue