MCPcopy Index your code
hub / github.com/python/cpython / _HashInfo

Class _HashInfo

Lib/test/support/hashlib_helper.py:296–350  ·  view source on GitHub ↗

Dataclass containing information for supported hash functions. Attributes ---------- canonical_name : _HashId The hash function canonical name. type : _HashTypeInfo The hash object types information. func : _HashTypeInfo The hash object constructors infor

Source from the content-addressed store, hash-verified

294
295
296class _HashInfo:
297 """Dataclass containing information for supported hash functions.
298
299 Attributes
300 ----------
301 canonical_name : _HashId
302 The hash function canonical name.
303 type : _HashTypeInfo
304 The hash object types information.
305 func : _HashTypeInfo
306 The hash object constructors information.
307 """
308
309 def __init__(
310 self,
311 canonical_name,
312 builtin_object_type_fullname,
313 openssl_object_type_fullname,
314 builtin_method_fullname,
315 openssl_method_fullname=None,
316 hashlib_method_fullname=None,
317 ):
318 """
319 - *canonical_name* must be a _HashId.
320
321 - *builtin_object_type_fullname* is the fully-qualified name
322 for the builtin HACL* type, e.g., "_md5.MD5Type".
323
324 - *openssl_object_type_fullname* is the fully-qualified name
325 for the OpenSSL wrapper type, e.g., "_hashlib.HASH".
326
327 - *builtin_method_fullname* is the fully-qualified name
328 of the HACL* hash constructor function, e.g., "_md5.md5".
329
330 - *openssl_method_fullname* is the fully-qualified name
331 of the "_hashlib" module method for the explicit OpenSSL
332 hash constructor function, e.g., "_hashlib.openssl_md5".
333
334 - *hashlib_method_fullname* is the fully-qualified name
335 of the "hashlib" module method for the explicit hash
336 constructor function, e.g., "hashlib.md5".
337 """
338 assert isinstance(canonical_name, _HashId), canonical_name
339 self.canonical_name = canonical_name
340 self.type = _HashTypeInfo(
341 canonical_name,
342 builtin_object_type_fullname,
343 openssl_object_type_fullname,
344 )
345 self.func = _HashFuncInfo(
346 canonical_name,
347 builtin_method_fullname,
348 openssl_method_fullname,
349 hashlib_method_fullname,
350 )
351
352
353_HASHINFO_DATABASE = frozendict({

Callers 1

hashlib_helper.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…