comparison mysrp.py @ 32:1af6865189ce

Update to work with Python 3.
author Daniel O'Connor <darius@dons.net.au>
date Sat, 14 Nov 2020 14:54:05 +1030
parents a53f90508a06
children
comparison
equal deleted inserted replaced
31:39bf6dec0753 32:1af6865189ce
162 if s2 and isinstance(s2, six.integer_types): 162 if s2 and isinstance(s2, six.integer_types):
163 s2 = long_to_bytes(s2) 163 s2 = long_to_bytes(s2)
164 if s3 and isinstance(s3, six.integer_types): 164 if s3 and isinstance(s3, six.integer_types):
165 s3 = long_to_bytes(s3) 165 s3 = long_to_bytes(s3)
166 s = s1 + s2 + s3 166 s = s1 + s2 + s3
167 return long(hash_class(s).hexdigest(), 16) 167 return int(hash_class(s).hexdigest(), 16)
168 168
169 169
170 def H( hash_class, *args, **kwargs ): 170 def H( hash_class, *args, **kwargs ):
171 h = hash_class() 171 h = hash_class()
172 172