Created
July 21, 2013 13:28
-
-
Save shuson/6048576 to your computer and use it in GitHub Desktop.
By reading RSA algorithm,to generate a series co-prime relation numbers is the basic task. So comes out of this basic method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if the return is 1, the a b are in coprime relation | |
| #else return the smallest common divisor | |
| def checker(a,b): | |
| while True: | |
| c = a%b | |
| if c == 0: | |
| return b | |
| a = b | |
| b = c |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def checker(a,b):
if a<=b:
return all([b%i for i in xrange(2,a)])
return False