MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / new

Function new

tools/python-3.11.9-amd64/Lib/hmac.py:167–184  ·  view source on GitHub ↗

Create a new hashing object and return it. key: bytes or buffer, The starting key for the hash. msg: bytes or buffer, Initial input for the hash, or None. digestmod: A hash name suitable for hashlib.new(). *OR* A hashlib constructor returning a new hash object. *OR*

(key, msg=None, digestmod='')

Source from the content-addressed store, hash-verified

165 return h.hexdigest()
166
167def new(key, msg=None, digestmod=''):
168 """Create a new hashing object and return it.
169
170 key: bytes or buffer, The starting key for the hash.
171 msg: bytes or buffer, Initial input for the hash, or None.
172 digestmod: A hash name suitable for hashlib.new(). *OR*
173 A hashlib constructor returning a new hash object. *OR*
174 A module supporting PEP 247.
175
176 Required as of 3.8, despite its position after the optional
177 msg argument. Passing it as a keyword argument is
178 recommended, though not required for legacy API reasons.
179
180 You can now feed arbitrary bytes into the object using its update()
181 method, and can ask for the hash value at any time by calling its digest()
182 or hexdigest() methods.
183 """
184 return HMAC(key, msg, digestmod)
185
186
187def digest(key, msg, digest):

Callers 2

pbkdf2_hmacFunction · 0.85
file_digestFunction · 0.85

Calls 1

HMACClass · 0.85

Tested by

no test coverage detected