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

Function _get_digest_constructor

Lib/hmac.py:29–39  ·  view source on GitHub ↗
(digest_like)

Source from the content-addressed store, hash-verified

27
28
29def _get_digest_constructor(digest_like):
30 if callable(digest_like):
31 return digest_like
32 if isinstance(digest_like, str):
33 def digest_wrapper(d=b''):
34 import hashlib
35 return hashlib.new(digest_like, d)
36 else:
37 def digest_wrapper(d=b''):
38 return digest_like.new(d)
39 return digest_wrapper
40
41
42class HMAC:

Callers 2

_init_oldMethod · 0.85
_compute_digest_fallbackFunction · 0.85

Calls 2

callableFunction · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected