diff options
author | Francisco Couzo <franciscouzo@gmail.com> | 2017-03-22 01:31:22 -0300 |
---|---|---|
committer | Francisco Couzo <franciscouzo@gmail.com> | 2017-03-22 01:31:22 -0300 |
commit | d69ef77f7698de677bd977483ba8c1c558b19d02 (patch) | |
tree | cf5d566dcc23fc767dd42ab0700bab565f6fddf0 /paramiko/rsakey.py | |
parent | 5061ee66b1cc0e9cba93be75f0978cd0830362ad (diff) | |
download | paramiko-d69ef77f7698de677bd977483ba8c1c558b19d02.tar.gz |
Improve __hash__ functions
Diffstat (limited to 'paramiko/rsakey.py')
-rw-r--r-- | paramiko/rsakey.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index fa2b4c44..8ad6d6e4 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -89,10 +89,8 @@ class RSAKey(PKey): return self.asbytes().decode('utf8', errors='ignore') def __hash__(self): - h = hash(self.get_name()) - h = h * 37 + hash(self.public_numbers.e) - h = h * 37 + hash(self.public_numbers.n) - return hash(h) + return hash((self.get_name(), self.public_numbers.e, + self.public_numbers.n)) def get_name(self): return 'ssh-rsa' |