{
    "mode": "pydoc",
    "parameter": "_hashlib",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/_hashlib/json",
    "generated": "2026-06-02T15:02:08Z",
    "sections": {
        "NAME": {
            "content": "hashlib - OpenSSL interface for hashlib module\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/hashlib.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.ValueError(builtins.Exception)\nUnsupportedDigestmodError\nbuiltins.object\nHASH\nHASHXOF\nHMAC\n",
            "subsections": [
                {
                    "name": "class HASH",
                    "content": "|  HASH(name, string=b'')\n|\n|  A hash is an object used to calculate a checksum of a string of information.\n|\n|  Methods:\n|\n|  update() -- updates the current digest with an additional string\n|  digest() -- return the current digest value\n|  hexdigest() -- return the current digest as a string of hexadecimal digits\n|  copy() -- return a copy of the current hash object\n|\n|  Attributes:\n|\n|  name -- the hash algorithm being used by this object\n|  digestsize -- number of bytes in this hashes output\n|\n|  Methods defined here:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  copy(self, /)\n|      Return a copy of the hash object.\n|\n|  digest(self, /)\n|      Return the digest value as a bytes object.\n|\n|  hexdigest(self, /)\n|      Return the digest value as a string of hexadecimal digits.\n|\n|  update(self, obj, /)\n|      Update this hash object's state with the provided string.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  blocksize\n|\n|  digestsize\n|\n|  name\n"
                },
                {
                    "name": "class HASHXOF",
                    "content": "|  HASHXOF(name, string=b'')\n|\n|  A hash is an object used to calculate a checksum of a string of information.\n|\n|  Methods:\n|\n|  update() -- updates the current digest with an additional string\n|  digest(length) -- return the current digest value\n|  hexdigest(length) -- return the current digest as a string of hexadecimal digits\n|  copy() -- return a copy of the current hash object\n|\n|  Attributes:\n|\n|  name -- the hash algorithm being used by this object\n|  digestsize -- number of bytes in this hashes output\n|\n|  Method resolution order:\n|      HASHXOF\n|      HASH\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  digest(self, /, length)\n|      Return the digest value as a bytes object.\n|\n|  hexdigest(self, /, length)\n|      Return the digest value as a string of hexadecimal digits.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  digestsize\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from HASH:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  copy(self, /)\n|      Return a copy of the hash object.\n|\n|  update(self, obj, /)\n|      Update this hash object's state with the provided string.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from HASH:\n|\n|  blocksize\n|\n|  name\n"
                },
                {
                    "name": "class HMAC",
                    "content": "|  The object used to calculate HMAC of a message.\n|\n|  Methods:\n|\n|  update() -- updates the current digest with an additional string\n|  digest() -- return the current digest value\n|  hexdigest() -- return the current digest as a string of hexadecimal digits\n|  copy() -- return a copy of the current hash object\n|\n|  Attributes:\n|\n|  name -- the name, including the hash algorithm used by this object\n|  digestsize -- number of bytes in digest() output\n|\n|  Methods defined here:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  copy(self, /)\n|      Return a copy (\"clone\") of the HMAC object.\n|\n|  digest(self, /)\n|      Return the digest of the bytes passed to the update() method so far.\n|\n|  hexdigest(self, /)\n|      Return hexadecimal digest of the bytes passed to the update() method so far.\n|\n|      This may be used to exchange the value safely in email or other non-binary\n|      environments.\n|\n|  update(self, /, msg)\n|      Update the HMAC object with msg.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  blocksize\n|\n|  digestsize\n|\n|  name\n"
                },
                {
                    "name": "class UnsupportedDigestmodError",
                    "content": "|  Method resolution order:\n|      UnsupportedDigestmodError\n|      builtins.ValueError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.ValueError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.ValueError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "compare_digest",
                    "content": "Return 'a == b'.\n\nThis function uses an approach designed to prevent\ntiming analysis, making it appropriate for cryptography.\n\na and b must both be of the same type: either str (ASCII only),\nor any bytes-like object.\n\nNote: If a and b are of different lengths, or if an error occurs,\na timing attack could theoretically reveal information about the\ntypes and lengths of a and b--but not their values.\n"
                },
                {
                    "name": "get_fips_mode",
                    "content": "Determine the OpenSSL FIPS mode of operation.\n\nFor OpenSSL 3.0.0 and newer it returns the state of the default provider\nin the default OSSL context. It's not quite the same as FIPSmode() but good\nenough for unittests.\n\nEffectively any non-zero return value indicates FIPS mode;\nvalues other than 1 may have additional significance.\n"
                },
                {
                    "name": "hmac_digest",
                    "content": "Single-shot HMAC.\n"
                },
                {
                    "name": "hmac_new",
                    "content": "Return a new hmac object.\n"
                },
                {
                    "name": "new",
                    "content": "Return a new hash object using the named algorithm.\n\nAn optional string argument may be provided and will be\nautomatically hashed.\n\nThe MD5 and SHA1 algorithms are always supported.\n"
                },
                {
                    "name": "openssl_md5",
                    "content": "Returns a md5 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha1",
                    "content": "Returns a sha1 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha224",
                    "content": "Returns a sha224 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha256",
                    "content": "Returns a sha256 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha384",
                    "content": "Returns a sha384 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha3_224",
                    "content": "Returns a sha3-224 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha3_256",
                    "content": "Returns a sha3-256 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha3_384",
                    "content": "Returns a sha3-384 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha3_512",
                    "content": "Returns a sha3-512 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_sha512",
                    "content": "Returns a sha512 hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_shake_128",
                    "content": "Returns a shake-128 variable hash object; optionally initialized with a string\n"
                },
                {
                    "name": "openssl_shake_256",
                    "content": "Returns a shake-256 variable hash object; optionally initialized with a string\n"
                },
                {
                    "name": "pbkdf2_hmac",
                    "content": "Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.\n"
                },
                {
                    "name": "scrypt",
                    "content": "scrypt password-based key derivation function.\n"
                }
            ]
        },
        "DATA": {
            "content": "opensslmdmethnames = frozenset({'blake2b', 'blake2s', 'md5', 'md5-s...\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/lib-dynload/hashlib.cpython-310-x8664-linux-gnu.so\n\n",
            "subsections": []
        }
    },
    "summary": "hashlib - OpenSSL interface for hashlib module",
    "flags": [],
    "examples": [],
    "see_also": []
}