hashlib API Reference

Full documentation for hashlib (Standard Library / Native)

hashlib.algorithms_available
Python Library Documentation: set object

class set(object)
 |  set() -> new empty set object
 |  set(iterable) -> new set object
 |
 |  Build an unordered collection of unique elements.
 |
 |  Methods defined here:
 |
 |  __and__(self, value, /)
 |      Return self&value.
 |
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x.
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __iand__(self, value, /)
 |      Return self&=value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __isub__(self, value, /)
 |      Return self-=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __ixor__(self, value, /)
 |      Return self^=value.
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __rand__(self, value, /)
 |      Return value&self.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __rsub__(self, value, /)
 |      Return value-self.
 |
 |  __rxor__(self, value, /)
 |      Return value^self.
 |
 |  __sizeof__(...)
 |      S.__sizeof__() -> size of S in memory, in bytes
 |
 |  __sub__(self, value, /)
 |      Return self-value.
 |
 |  __xor__(self, value, /)
 |      Return self^value.
 |
 |  add(...)
 |      Add an element to a set.
 |
 |      This has no effect if the element is already present.
 |
 |  clear(...)
 |      Remove all elements from this set.
 |
 |  copy(...)
 |      Return a shallow copy of a set.
 |
 |  difference(...)
 |      Return the difference of two or more sets as a new set.
 |
 |      (i.e. all elements that are in this set but not the others.)
 |
 |  difference_update(...)
 |      Remove all elements of another set from this set.
 |
 |  discard(...)
 |      Remove an element from a set if it is a member.
 |
 |      Unlike set.remove(), the discard() method does not raise
 |      an exception when an element is missing from the set.
 |
 |  intersection(...)
 |      Return the intersection of two sets as a new set.
 |
 |      (i.e. all elements that are in both sets.)
 |
 |  intersection_update(...)
 |      Update a set with the intersection of itself and another.
 |
 |  isdisjoint(...)
 |      Return True if two sets have a null intersection.
 |
 |  issubset(self, other, /)
 |      Test whether every element in the set is in other.
 |
 |  issuperset(self, other, /)
 |      Test whether every element in other is in the set.
 |
 |  pop(...)
 |      Remove and return an arbitrary set element.
 |      Raises KeyError if the set is empty.
 |
 |  remove(...)
 |      Remove an element from a set; it must be a member.
 |
 |      If the element is not a member, raise a KeyError.
 |
 |  symmetric_difference(...)
 |      Return the symmetric difference of two sets as a new set.
 |
 |      (i.e. all elements that are in exactly one of the sets.)
 |
 |  symmetric_difference_update(...)
 |      Update a set with the symmetric difference of itself and another.
 |
 |  union(...)
 |      Return the union of sets as a new set.
 |
 |      (i.e. all elements that are in either set.)
 |
 |  update(...)
 |      Update a set with the union of itself and others.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
hashlib.algorithms_guaranteed
Python Library Documentation: set object

class set(object)
 |  set() -> new empty set object
 |  set(iterable) -> new set object
 |
 |  Build an unordered collection of unique elements.
 |
 |  Methods defined here:
 |
 |  __and__(self, value, /)
 |      Return self&value.
 |
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x.
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __iand__(self, value, /)
 |      Return self&=value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __isub__(self, value, /)
 |      Return self-=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __ixor__(self, value, /)
 |      Return self^=value.
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __rand__(self, value, /)
 |      Return value&self.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __rsub__(self, value, /)
 |      Return value-self.
 |
 |  __rxor__(self, value, /)
 |      Return value^self.
 |
 |  __sizeof__(...)
 |      S.__sizeof__() -> size of S in memory, in bytes
 |
 |  __sub__(self, value, /)
 |      Return self-value.
 |
 |  __xor__(self, value, /)
 |      Return self^value.
 |
 |  add(...)
 |      Add an element to a set.
 |
 |      This has no effect if the element is already present.
 |
 |  clear(...)
 |      Remove all elements from this set.
 |
 |  copy(...)
 |      Return a shallow copy of a set.
 |
 |  difference(...)
 |      Return the difference of two or more sets as a new set.
 |
 |      (i.e. all elements that are in this set but not the others.)
 |
 |  difference_update(...)
 |      Remove all elements of another set from this set.
 |
 |  discard(...)
 |      Remove an element from a set if it is a member.
 |
 |      Unlike set.remove(), the discard() method does not raise
 |      an exception when an element is missing from the set.
 |
 |  intersection(...)
 |      Return the intersection of two sets as a new set.
 |
 |      (i.e. all elements that are in both sets.)
 |
 |  intersection_update(...)
 |      Update a set with the intersection of itself and another.
 |
 |  isdisjoint(...)
 |      Return True if two sets have a null intersection.
 |
 |  issubset(self, other, /)
 |      Test whether every element in the set is in other.
 |
 |  issuperset(self, other, /)
 |      Test whether every element in other is in the set.
 |
 |  pop(...)
 |      Remove and return an arbitrary set element.
 |      Raises KeyError if the set is empty.
 |
 |  remove(...)
 |      Remove an element from a set; it must be a member.
 |
 |      If the element is not a member, raise a KeyError.
 |
 |  symmetric_difference(...)
 |      Return the symmetric difference of two sets as a new set.
 |
 |      (i.e. all elements that are in exactly one of the sets.)
 |
 |  symmetric_difference_update(...)
 |      Update a set with the symmetric difference of itself and another.
 |
 |  union(...)
 |      Return the union of sets as a new set.
 |
 |      (i.e. all elements that are in either set.)
 |
 |  update(...)
 |      Update a set with the union of itself and others.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
hashlib.blake2b
Python Library Documentation: class blake2b in module _blake2

class blake2b(builtins.object)
 |  blake2b(data=b'', /, *, digest_size=64, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False, usedforsecurity=True)
 |
 |  Return a new BLAKE2b hash object.
 |
 |  Methods defined here:
 |
 |  copy(self, /)
 |      Return a copy of the hash object.
 |
 |  digest(self, /)
 |      Return the digest value as a bytes object.
 |
 |  hexdigest(self, /)
 |      Return the digest value as a string of hexadecimal digits.
 |
 |  update(self, data, /)
 |      Update this hash object's state with the provided bytes-like object.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  block_size
 |
 |  digest_size
 |
 |  name
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_DIGEST_SIZE = 64
 |
 |  MAX_KEY_SIZE = 64
 |
 |  PERSON_SIZE = 16
 |
 |  SALT_SIZE = 16
hashlib.blake2s
Python Library Documentation: class blake2s in module _blake2

class blake2s(builtins.object)
 |  blake2s(data=b'', /, *, digest_size=32, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False, usedforsecurity=True)
 |
 |  Return a new BLAKE2s hash object.
 |
 |  Methods defined here:
 |
 |  copy(self, /)
 |      Return a copy of the hash object.
 |
 |  digest(self, /)
 |      Return the digest value as a bytes object.
 |
 |  hexdigest(self, /)
 |      Return the digest value as a string of hexadecimal digits.
 |
 |  update(self, data, /)
 |      Update this hash object's state with the provided bytes-like object.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  block_size
 |
 |  digest_size
 |
 |  name
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_DIGEST_SIZE = 32
 |
 |  MAX_KEY_SIZE = 32
 |
 |  PERSON_SIZE = 8
 |
 |  SALT_SIZE = 8
hashlib.file_digest
Python Library Documentation: function file_digest in module hashlib

file_digest(fileobj, digest, /, *, _bufsize=262144)
    Hash the contents of a file-like object. Returns a digest object.

    *fileobj* must be a file-like object opened for reading in binary mode.
    It accepts file objects from open(), io.BytesIO(), and SocketIO objects.
    The function may bypass Python's I/O and use the file descriptor *fileno*
    directly.

    *digest* must either be a hash algorithm name as a *str*, a hash
    constructor, or a callable that returns a hash object.
hashlib.md5
Python Library Documentation: built-in function openssl_md5 in module _hashlib

openssl_md5(string=b'', *, usedforsecurity=True)
    Returns a md5 hash object; optionally initialized with a string
hashlib.new
Python Library Documentation: function __hash_new in module hashlib

__hash_new(name, data=b'', **kwargs)
    new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
hashlib.pbkdf2_hmac
Python Library Documentation: built-in function pbkdf2_hmac in module _hashlib

pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None)
    Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.
hashlib.scrypt
Python Library Documentation: built-in function scrypt in module _hashlib

scrypt(password, *, salt=None, n=None, r=None, p=None, maxmem=0, dklen=64)
    scrypt password-based key derivation function.
hashlib.sha1
Python Library Documentation: built-in function openssl_sha1 in module _hashlib

openssl_sha1(string=b'', *, usedforsecurity=True)
    Returns a sha1 hash object; optionally initialized with a string
hashlib.sha224
Python Library Documentation: built-in function openssl_sha224 in module _hashlib

openssl_sha224(string=b'', *, usedforsecurity=True)
    Returns a sha224 hash object; optionally initialized with a string
hashlib.sha256
Python Library Documentation: built-in function openssl_sha256 in module _hashlib

openssl_sha256(string=b'', *, usedforsecurity=True)
    Returns a sha256 hash object; optionally initialized with a string
hashlib.sha384
Python Library Documentation: built-in function openssl_sha384 in module _hashlib

openssl_sha384(string=b'', *, usedforsecurity=True)
    Returns a sha384 hash object; optionally initialized with a string
hashlib.sha3_224
Python Library Documentation: built-in function openssl_sha3_224 in module _hashlib

openssl_sha3_224(string=b'', *, usedforsecurity=True)
    Returns a sha3-224 hash object; optionally initialized with a string
hashlib.sha3_256
Python Library Documentation: built-in function openssl_sha3_256 in module _hashlib

openssl_sha3_256(string=b'', *, usedforsecurity=True)
    Returns a sha3-256 hash object; optionally initialized with a string
hashlib.sha3_384
Python Library Documentation: built-in function openssl_sha3_384 in module _hashlib

openssl_sha3_384(string=b'', *, usedforsecurity=True)
    Returns a sha3-384 hash object; optionally initialized with a string
hashlib.sha3_512
Python Library Documentation: built-in function openssl_sha3_512 in module _hashlib

openssl_sha3_512(string=b'', *, usedforsecurity=True)
    Returns a sha3-512 hash object; optionally initialized with a string
hashlib.sha512
Python Library Documentation: built-in function openssl_sha512 in module _hashlib

openssl_sha512(string=b'', *, usedforsecurity=True)
    Returns a sha512 hash object; optionally initialized with a string
hashlib.shake_128
Python Library Documentation: built-in function openssl_shake_128 in module _hashlib

openssl_shake_128(string=b'', *, usedforsecurity=True)
    Returns a shake-128 variable hash object; optionally initialized with a string
hashlib.shake_256
Python Library Documentation: built-in function openssl_shake_256 in module _hashlib

openssl_shake_256(string=b'', *, usedforsecurity=True)
    Returns a shake-256 variable hash object; optionally initialized with a string