Skip to content
Myr

for RFC-7616 add SHA-256 and SHA-512

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

authored by David Poole · committed by David Poole · parent 234f80a · Browse files · 1 file+12 added−0 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+12 added−0 removed

  • other:+12 added−0 removed

1 file+12 added−0 removed

modified:requests/auth.py+12 added
151 unmodified lines
152 if isinstance(x, str):153 x = x.encode('utf-8')154 return hashlib.sha1(x).hexdigest()155 hash_utf8 = sha_utf8156 elif _algorithm == 'SHA-256':157 def sha256_utf8(x):158 if isinstance(x, str):159 x = x.encode('utf-8')160 return hashlib.sha256(x).hexdigest()161 hash_utf8 = sha256_utf8162 elif _algorithm == 'SHA-512':163 def sha512_utf8(x):164 if isinstance(x, str):165 x = x.encode('utf-8')166 return hashlib.sha512(x).hexdigest()167 hash_utf8 = sha512_utf8168169 KD = lambda s, d: hash_utf8("%s:%s" % (s, d))170171 if hash_utf8 is None:
134 unmodified lines