Skip to content
Myr

blah

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent b0e2e4f · Browse files · 1 file+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−2 removed

  • other:+10 added−2 removed

1 file+10 added−2 removed

modified:requests/auth.py+10 added-2 removed
76 unmodified lines
7778 algorithm = algorithm.upper()79 # lambdas assume digest modules are imported at the top level80 if algorithm == 'MD5':81 def h(x):82 if isinstance(x, str):83 x = x.encode('utf-8')81 H = lambda x: hashlib.md5(x).hexdigest()84 return hashlib.md5(x).hexdigest()85 H = h86 elif algorithm == 'SHA':87 def h(x):88 if isinstance(x, str):89 x = x.encode('utf-8')83 H = lambda x: hashlib.sha1(x).hexdigest()90 return hashlib.sha1(x).hexdigest()91 H = h92 # XXX MD5-sess93 KD = lambda s, d: H("%s:%s" % (s, d))9495 if H is None:
57 unmodified lines