MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_cnonce

Method get_cnonce

Lib/urllib/request.py:1105–1114  ·  view source on GitHub ↗
(self, nonce)

Source from the content-addressed store, hash-verified

1103 return resp
1104
1105 def get_cnonce(self, nonce):
1106 # The cnonce-value is an opaque
1107 # quoted string value provided by the client and used by both client
1108 # and server to avoid chosen plaintext attacks, to provide mutual
1109 # authentication, and to provide some message integrity protection.
1110 # This isn't a fabulous effort, but it's probably Good Enough.
1111 s = "%s:%s:%s:" % (self.nonce_count, nonce, time.ctime())
1112 b = s.encode("ascii") + _randombytes(8)
1113 dig = hashlib.sha1(b).hexdigest()
1114 return dig[:16]
1115
1116 def get_authorization(self, req, chal):
1117 try:

Callers 1

get_authorizationMethod · 0.95

Calls 4

ctimeMethod · 0.45
encodeMethod · 0.45
hexdigestMethod · 0.45
sha1Method · 0.45

Tested by

no test coverage detected