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

Function new

Lib/hmac.py:201–218  ·  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

199
200
201def new(key, msg=None, digestmod=''):
202 """Create a new hashing object and return it.
203
204 key: bytes or buffer, The starting key for the hash.
205 msg: bytes or buffer, Initial input for the hash, or None.
206 digestmod: A hash name suitable for hashlib.new(). *OR*
207 A hashlib constructor returning a new hash object. *OR*
208 A module supporting PEP 247.
209
210 Required as of 3.8, despite its position after the optional
211 msg argument. Passing it as a keyword argument is
212 recommended, though not required for legacy API reasons.
213
214 You can now feed arbitrary bytes into the object using its update()
215 method, and can ask for the hash value at any time by calling its digest()
216 or hexdigest() methods.
217 """
218 return HMAC(key, msg, digestmod)
219
220
221def digest(key, msg, digest):

Callers 15

mainFunction · 0.85
mainFunction · 0.85
interpreter_with_configFunction · 0.85
bench_cpython_codeFunction · 0.85
bench_rustpython_codeFunction · 0.85
criterion_benchmarkFunction · 0.85
bench_cpython_codeFunction · 0.85
benchmark_file_executionFunction · 0.85
benchmark_file_parsingFunction · 0.85
benchmark_pystoneFunction · 0.85
criterion_benchmarkFunction · 0.85
file_digestFunction · 0.85

Calls 1

HMACClass · 0.85

Tested by 15

__new__Method · 0.68
stateMethod · 0.68
compileMethod · 0.68
fromMethod · 0.68
newMethod · 0.68
process_instructionMethod · 0.68
basic_push_popFunction · 0.68
cross_chunk_push_popFunction · 0.68
alignmentFunction · 0.68
test_gc_state_defaultFunction · 0.68
test_gc_enable_disableFunction · 0.68