MCPcopy
hub / github.com/encode/httpx / _get_client_nonce

Method _get_client_nonce

httpx/_auth.py:303–309  ·  view source on GitHub ↗
(self, nonce_count: int, nonce: bytes)

Source from the content-addressed store, hash-verified

301 return "Digest " + self._get_header_value(format_args)
302
303 def _get_client_nonce(self, nonce_count: int, nonce: bytes) -> bytes:
304 s = str(nonce_count).encode()
305 s += nonce
306 s += time.ctime().encode()
307 s += os.urandom(8)
308
309 return hashlib.sha1(s).hexdigest()[:16].encode()
310
311 def _get_header_value(self, header_fields: dict[str, bytes]) -> str:
312 NON_QUOTED_FIELDS = ("algorithm", "qop", "nc")

Callers 1

_build_auth_headerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected