Replace use of deprecated sha module

This commit is contained in:
Jean-Paul Calderone 2018-04-26 15:00:36 -04:00
parent 6d9f0c59b7
commit 206ab732e6
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ system where Tahoe is installed, or in a source tree with setup.py like this:
setup.py run_with_pythonpath -p -c 'misc/make-canary-files.py ARGS..'
"""
import os, sha
import os, hashlib
from twisted.python import usage
from allmydata.immutable import upload
from allmydata.util import base32
@ -96,7 +96,7 @@ convergence = base32.a2b(convergence_s)
def get_permuted_peers(key):
results = []
for nodeid in nodes:
permuted = sha.new(key + nodeid).digest()
permuted = hashlib.sha1(key + nodeid).digest()
results.append((permuted, nodeid))
results.sort(lambda a,b: cmp(a[0], b[0]))
return [ r[1] for r in results ]