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

Function __hash_new

Lib/hashlib.py:152–166  ·  view source on GitHub ↗

new(name, data=b'') - Return a new hashing object using the named algorithm; optionally initialized with data (which must be a bytes-like object).

(name, *args, **kwargs)

Source from the content-addressed store, hash-verified

150
151
152def __hash_new(name, *args, **kwargs):
153 """new(name, data=b'') - Return a new hashing object using the named algorithm;
154 optionally initialized with data (which must be a bytes-like object).
155 """
156 if name in __block_openssl_constructor:
157 # Prefer our builtin blake2 implementation.
158 return __get_builtin_constructor(name)(*args, **kwargs)
159 try:
160 return _hashlib.new(name, *args, **kwargs)
161 except ValueError:
162 # If the _hashlib module (OpenSSL) doesn't support the named
163 # hash, try using our builtin implementations.
164 # This allows for SHA224/256 and SHA384/512 support even though
165 # the OpenSSL library prior to 0.9.8 doesn't provide them.
166 return __get_builtin_constructor(name)(*args, **kwargs)
167
168
169try:

Callers

nothing calls this directly

Calls 2

newMethod · 0.45

Tested by

no test coverage detected