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

Method hmac_digest_by_name

Lib/test/test_hmac.py:225–233  ·  view source on GitHub ↗

Alternative implementation of hmac_digest(). Unlike hmac_digest(), this method may assert the type of 'hashname' as it should only be used in tests that are expected to compute a HMAC digest.

(self, key, msg=None, *, hashname)

Source from the content-addressed store, hash-verified

223 return self.hmac_new(key, msg, digestmod=hashname)
224
225 def hmac_digest_by_name(self, key, msg=None, *, hashname):
226 """Alternative implementation of hmac_digest().
227
228 Unlike hmac_digest(), this method may assert the type of 'hashname'
229 as it should only be used in tests that are expected to compute a
230 HMAC digest.
231 """
232 self.assertIsInstance(hashname, str)
233 return self.hmac_digest(key, msg, digestmod=hashname)
234
235 def assert_hmac(
236 self, key, msg, hexdigest, hashfunc, hashname, digest_size, block_size

Callers

nothing calls this directly

Calls 2

assertIsInstanceMethod · 0.80
hmac_digestMethod · 0.45

Tested by

no test coverage detected