chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e3598a2-53c8-4f28-9bfc-8dc91642c426 | CPython Docs | file://datasets/cpython/Doc/library/uu.rst | unknown | c966ce63-e16b-4cd2-b80f-050a9f6af57b | 49,740 | supabase-export-v2 | fdbde9d2da8506f4 | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
The last version of Python that provided the :mod:`!uu` module was
`Python 3.12 <https://docs.python.org/3.12/library/uu.html>`_. | trusted_official_docs | CPython Docs | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
The last version of Python that provided the :mod:`!uu` module was
`Python 3.12 <https://docs.python.org/3.12/library/uu.html>`_. | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
The last version of Python that provided the :mod:`!uu` module was
`Python 3.12 <https://docs.python.org/3.12/library/uu.html>`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0813a957-c471-42e3-9a76-63dbe1d65468 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,782 | supabase-export-v2 | 832b68b1db9e3f34 | .. data:: algorithms_available
A set containing the names of the hash algorithms that are available in the
running Python interpreter. These names will be recognized when passed to
:func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The
same algorithm may appear multiple times in this set under diffe... | trusted_official_docs | CPython Docs | .. data:: algorithms_available
A set containing the names of the hash algorithms that are available in the
running Python interpreter. These names will be recognized when passed to
:func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The
same algorithm may appear multiple times in this set under diffe... | .. data:: algorithms_available
A set containing the names of the hash algorithms that are available in the
running Python interpreter. These names will be recognized when passed to
:func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The
same algorithm may appear multiple times in this set under diffe... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a3ff055-7ca4-4b68-aaee-ed6b733b8be6 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,799 | supabase-export-v2 | de5a84f81f197cda | .. method:: hash.hexdigest()
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value safely in email or other non-binary environments. | trusted_official_docs | CPython Docs | .. method:: hash.hexdigest()
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value safely in email or other non-binary environments. | .. method:: hash.hexdigest()
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value safely in email or other non-binary environments. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ac28af1-e7bd-4a72-985d-4425c0c26c15 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,752 | supabase-export-v2 | a703dc6f661d5300 | point you can ask it for the :dfn:`digest` of the concatenation of the data fed to it so far using the :meth:`digest()<hash.digest>` or :meth:`hexdigest()<hash.hexdigest>` methods.
To allow multithreading, the Python :term:`GIL` is released while computing a
hash supplied more than 2047 bytes of data at once in its con... | trusted_official_docs | CPython Docs | point you can ask it for the :dfn:`digest` of the concatenation of the data fed to it so far using the :meth:`digest()<hash.digest>` or :meth:`hexdigest()<hash.hexdigest>` methods.
To allow multithreading, the Python :term:`GIL` is released while computing a
hash supplied more than 2047 bytes of data at once in its con... | point you can ask it for the :dfn:`digest` of the concatenation of the data fed to it so far using the :meth:`digest()<hash.digest>` or :meth:`hexdigest()<hash.hexdigest>` methods.
To allow multithreading, the Python :term:`GIL` is released while computing a
hash supplied more than 2047 bytes of data at once in its con... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0af32b48-b7ff-491b-9d31-c421ad62b9b1 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,806 | supabase-export-v2 | f3b4b8ec16754b63 | .. method:: shake.digest(length)
Return the digest of the data passed to the :meth:`~hash.update` method so far. This is a bytes object of size *length* which may contain bytes in
the whole range from 0 to 255. | trusted_official_docs | CPython Docs | .. method:: shake.digest(length)
Return the digest of the data passed to the :meth:`~hash.update` method so far. This is a bytes object of size *length* which may contain bytes in
the whole range from 0 to 255. | .. method:: shake.digest(length)
Return the digest of the data passed to the :meth:`~hash.update` method so far. This is a bytes object of size *length* which may contain bytes in
the whole range from 0 to 255. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0afe7616-109c-4e07-b390-24dc0a0d4342 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,843 | supabase-export-v2 | 38bdee1dd26f5c6c | * **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes,
* **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any
size between 1 and 32 bytes. | trusted_official_docs | CPython Docs | * **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes,
* **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any
size between 1 and 32 bytes. | * **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes,
* **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any
size between 1 and 32 bytes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0d8ac8e1-573a-49aa-9974-c492eec5c845 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,931 | supabase-export-v2 | bbbc77974b447074 | You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see https://creativecommons.org/publicdomain/zero/1.0/.
The following people have helped with development or contributed their changes
to the project and the public domain according to the Creative Commons Public
Domai... | trusted_official_docs | CPython Docs | You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see https://creativecommons.org/publicdomain/zero/1.0/.
The following people have helped with development or contributed their changes
to the project and the public domain according to the Creative Commons Public
Domai... | You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see https://creativecommons.org/publicdomain/zero/1.0/.
The following people have helped with development or contributed their changes
to the project and the public domain according to the Creative Commons Public
Domai... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
124ae67f-3105-4591-82a5-e4a30130d239 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,755 | supabase-export-v2 | 9d84b4dd3b2b96aa | available as well, though it may be missing or blocked if you are using a rare "FIPS compliant" build of Python. These correspond to :data:`algorithms_guaranteed`.
Additional algorithms may also be available if your Python distribution's
:mod:`!hashlib` was linked against a build of OpenSSL that provides others. Others... | trusted_official_docs | CPython Docs | available as well, though it may be missing or blocked if you are using a rare "FIPS compliant" build of Python. These correspond to :data:`algorithms_guaranteed`.
Additional algorithms may also be available if your Python distribution's
:mod:`!hashlib` was linked against a build of OpenSSL that provides others. Others... | available as well, though it may be missing or blocked if you are using a rare "FIPS compliant" build of Python. These correspond to :data:`algorithms_guaranteed`.
Additional algorithms may also be available if your Python distribution's
:mod:`!hashlib` was linked against a build of OpenSSL that provides others. Others... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1340a707-5fe4-4a7b-b947-7f0ee14ef8d2 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,746 | supabase-export-v2 | d4104ce327f91f78 | --------------
This module implements a common interface to many different hash algorithms. Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512,
(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the FIPS
202 standard`_) as well as the legacy algorithms SHA1 (`formerly part o... | trusted_official_docs | CPython Docs | --------------
This module implements a common interface to many different hash algorithms. Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512,
(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the FIPS
202 standard`_) as well as the legacy algorithms SHA1 (`formerly part o... | --------------
This module implements a common interface to many different hash algorithms. Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512,
(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the FIPS
202 standard`_) as well as the legacy algorithms SHA1 (`formerly part o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18f676c2-3149-4394-8438-76910fbba95f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,865 | supabase-export-v2 | ee84ebcf430d01f5 | * *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in sequential mode).
* *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for
BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode). | trusted_official_docs | CPython Docs | * *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in sequential mode).
* *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for
BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode). | * *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in sequential mode).
* *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for
BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f46a3e6-28c4-470a-bd84-1b0d31050fbd | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,899 | supabase-export-v2 | d57cc015b630e42e | Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used in HMAC construction with :mod:`hmac` module::
>>> import hmac, hashlib
>>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)
>>> m.update(b'message')
>>> m.hexdigest()
'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8... | trusted_official_docs | CPython Docs | Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used in HMAC construction with :mod:`hmac` module::
>>> import hmac, hashlib
>>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)
>>> m.update(b'message')
>>> m.hexdigest()
'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8... | Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used in HMAC construction with :mod:`hmac` module::
>>> import hmac, hashlib
>>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)
>>> m.update(b'message')
>>> m.hexdigest()
'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22920498-90b7-4258-98e2-ae896a930d56 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,795 | supabase-export-v2 | e1f7c4aa867e7f0f | .. method:: hash.update(data)
Update the hash object with the :term:`bytes-like object`. Repeated calls are equivalent to a single call with the
concatenation of all the arguments: ``m.update(a); m.update(b)`` is
equivalent to ``m.update(a+b)``. | trusted_official_docs | CPython Docs | .. method:: hash.update(data)
Update the hash object with the :term:`bytes-like object`. Repeated calls are equivalent to a single call with the
concatenation of all the arguments: ``m.update(a); m.update(b)`` is
equivalent to ``m.update(a+b)``. | .. method:: hash.update(data)
Update the hash object with the :term:`bytes-like object`. Repeated calls are equivalent to a single call with the
concatenation of all the arguments: ``m.update(a); m.update(b)`` is
equivalent to ``m.update(a+b)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2547603c-c7c8-4f8c-8347-cb488b53cbcd | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,816 | supabase-export-v2 | 0779dc6d6e09779b | objects from builtin :func:`open`, :class:`~io.BytesIO` instances, SocketIO objects from :meth:`socket.socket.makefile`, and similar. *fileobj* must be opened in blocking mode, otherwise a :exc:`BlockingIOError` may be raised.
The function may bypass Python's I/O and use the file descriptor
from :meth:`~io.IOBase.file... | trusted_official_docs | CPython Docs | objects from builtin :func:`open`, :class:`~io.BytesIO` instances, SocketIO objects from :meth:`socket.socket.makefile`, and similar. *fileobj* must be opened in blocking mode, otherwise a :exc:`BlockingIOError` may be raised.
The function may bypass Python's I/O and use the file descriptor
from :meth:`~io.IOBase.file... | objects from builtin :func:`open`, :class:`~io.BytesIO` instances, SocketIO objects from :meth:`socket.socket.makefile`, and similar. *fileobj* must be opened in blocking mode, otherwise a :exc:`BlockingIOError` may be raised.
The function may bypass Python's I/O and use the file descriptor
from :meth:`~io.IOBase.file... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
26960530-a535-4571-afa2-7d950768aa03 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,881 | supabase-export-v2 | c1fc52b4dfdff015 | Simple hashing """"""""""""""
To calculate hash of some data, you should first construct a hash object by
calling the appropriate constructor function (:func:`blake2b` or
:func:`blake2s`), then update it with the data by calling :meth:`~hash.update` on the
object, and, finally, get the digest out of the object by calli... | trusted_official_docs | CPython Docs | Simple hashing """"""""""""""
To calculate hash of some data, you should first construct a hash object by
calling the appropriate constructor function (:func:`blake2b` or
:func:`blake2s`), then update it with the data by calling :meth:`~hash.update` on the
object, and, finally, get the digest out of the object by calli... | Simple hashing """"""""""""""
To calculate hash of some data, you should first construct a hash object by
calling the appropriate constructor function (:func:`blake2b` or
:func:`blake2s`), then update it with the data by calling :meth:`~hash.update` on the
object, and, finally, get the digest out of the object by calli... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27983243-3f54-4ccf-899e-9a1869ec8e40 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,855 | supabase-export-v2 | 875b204e5a428cc0 | * *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s).
* *person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes
for BLAKE2s). | trusted_official_docs | CPython Docs | * *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s).
* *person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes
for BLAKE2s). | * *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s).
* *person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes
for BLAKE2s). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28509172-33bc-4b3d-9c78-33b4a4f84256 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,779 | supabase-export-v2 | d704d2d486600c92 | .. data:: algorithms_guaranteed
A set containing the names of the hash algorithms guaranteed to be supported
by this module on all platforms. Note that 'md5' is in this list despite
some upstream vendors offering an odd "FIPS compliant" Python build that
excludes it. | trusted_official_docs | CPython Docs | .. data:: algorithms_guaranteed
A set containing the names of the hash algorithms guaranteed to be supported
by this module on all platforms. Note that 'md5' is in this list despite
some upstream vendors offering an odd "FIPS compliant" Python build that
excludes it. | .. data:: algorithms_guaranteed
A set containing the names of the hash algorithms guaranteed to be supported
by this module on all platforms. Note that 'md5' is in this list despite
some upstream vendors offering an odd "FIPS compliant" Python build that
excludes it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
29769b0c-b44e-4fee-a6ee-0d8476b7b16a | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,867 | supabase-export-v2 | 1d6cf5924481f715 | * *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode).
* *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for
BLAKE2s, 0 in sequential mode). | trusted_official_docs | CPython Docs | * *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode).
* *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for
BLAKE2s, 0 in sequential mode). | * *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode).
* *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for
BLAKE2s, 0 in sequential mode). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bb106f4-c6f6-4f5a-9085-a52d7f87a7fd | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,771 | supabase-export-v2 | 9d342ebdc852036e | .. function:: new(name[, data], *, usedforsecurity=True)
Is a generic constructor that takes the string *name* of the desired
algorithm as its first parameter. It also exists to allow access to the
above listed hashes as well as any other algorithms that your OpenSSL
library may offer. | trusted_official_docs | CPython Docs | .. function:: new(name[, data], *, usedforsecurity=True)
Is a generic constructor that takes the string *name* of the desired
algorithm as its first parameter. It also exists to allow access to the
above listed hashes as well as any other algorithms that your OpenSSL
library may offer. | .. function:: new(name[, data], *, usedforsecurity=True)
Is a generic constructor that takes the string *name* of the desired
algorithm as its first parameter. It also exists to allow access to the
above listed hashes as well as any other algorithms that your OpenSSL
library may offer. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bb4e54c-5a08-4bbe-aeee-bfb1cfc83d8f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,904 | supabase-export-v2 | 314590702e5e59a1 | of randomized hashing may reduce the amount of security provided by a digital signature when all portions of the message are prepared by the signer.
(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
<https://csrc.nist.gov/pubs/sp/800/106/final>`_) | trusted_official_docs | CPython Docs | of randomized hashing may reduce the amount of security provided by a digital signature when all portions of the message are prepared by the signer.
(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
<https://csrc.nist.gov/pubs/sp/800/106/final>`_) | of randomized hashing may reduce the amount of security provided by a digital signature when all portions of the message are prepared by the signer.
(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
<https://csrc.nist.gov/pubs/sp/800/106/final>`_) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cda3d06-7552-4c71-937e-247839969378 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,903 | supabase-export-v2 | 9f08dea02124eb32 | major goal, but the current concentration on attacking cryptographic hash functions may result in a given cryptographic hash function providing less collision resistance than expected.
Randomized
hashing offers the signer additional protection by reducing the likelihood
that a preparer can generate two or more messag... | trusted_official_docs | CPython Docs | major goal, but the current concentration on attacking cryptographic hash functions may result in a given cryptographic hash function providing less collision resistance than expected.
Randomized
hashing offers the signer additional protection by reducing the likelihood
that a preparer can generate two or more messag... | major goal, but the current concentration on attacking cryptographic hash functions may result in a given cryptographic hash function providing less collision resistance than expected.
Randomized
hashing offers the signer additional protection by reducing the likelihood
that a preparer can generate two or more messag... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ec6f2de-c147-4dc5-8d9d-01d3688b7aab | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,825 | supabase-export-v2 | 4a5f4700ef3232c9 | Key derivation --------------
Key derivation and key stretching algorithms are designed for secure password
hashing. Naive algorithms such as ``sha1(password)`` are not resistant against
brute-force attacks. A good password hashing function must be tunable, slow, and
include a `salt <https://en.wikipedia.org/wiki/Salt_... | trusted_official_docs | CPython Docs | Key derivation --------------
Key derivation and key stretching algorithms are designed for secure password
hashing. Naive algorithms such as ``sha1(password)`` are not resistant against
brute-force attacks. A good password hashing function must be tunable, slow, and
include a `salt <https://en.wikipedia.org/wiki/Salt_... | Key derivation --------------
Key derivation and key stretching algorithms are designed for secure password
hashing. Naive algorithms such as ``sha1(password)`` are not resistant against
brute-force attacks. A good password hashing function must be tunable, slow, and
include a `salt <https://en.wikipedia.org/wiki/Salt_... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ed9acbd-216c-43df-b407-899e3ac84c66 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,887 | supabase-export-v2 | 0bad47e7baff063b | hashlib import blake2b >>> items = [b'Hello', b' ', b'world'] >>> h = blake2b() >>> for item in items: ... h.update(item) ... >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
Using different digest sizes
""""""""""""""""... | trusted_official_docs | CPython Docs | hashlib import blake2b >>> items = [b'Hello', b' ', b'world'] >>> h = blake2b() >>> for item in items: ... h.update(item) ... >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
Using different digest sizes
""""""""""""""""... | hashlib import blake2b >>> items = [b'Hello', b' ', b'world'] >>> h = blake2b() >>> for item in items: ... h.update(item) ... >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
Using different digest sizes
""""""""""""""""... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3080b074-fe24-4c98-8e0e-5a8b3dfaea1f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,766 | supabase-export-v2 | 5c778b2107701170 | To obtain the digest of the byte string ``b"Nobody inspects the spammish repetition"``::
>>> import hashlib
>>> m = hashlib.sha256()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x... | trusted_official_docs | CPython Docs | To obtain the digest of the byte string ``b"Nobody inspects the spammish repetition"``::
>>> import hashlib
>>> m = hashlib.sha256()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x... | To obtain the digest of the byte string ``b"Nobody inspects the spammish repetition"``::
>>> import hashlib
>>> m = hashlib.sha256()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
320d963e-2b73-42f9-bb67-22d9bf4631d2 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,751 | supabase-export-v2 | e7f97a8b63393365 | Hash algorithms ---------------
There is one constructor method named for each type of :dfn:`hash`. All return
a hash object with the same simple interface. For example: use :func:`sha256`
to create a SHA-256 hash object. You can now feed this object with
:term:`bytes-like objects <bytes-like object>` (normally :class:... | trusted_official_docs | CPython Docs | Hash algorithms ---------------
There is one constructor method named for each type of :dfn:`hash`. All return
a hash object with the same simple interface. For example: use :func:`sha256`
to create a SHA-256 hash object. You can now feed this object with
:term:`bytes-like objects <bytes-like object>` (normally :class:... | Hash algorithms ---------------
There is one constructor method named for each type of :dfn:`hash`. All return
a hash object with the same simple interface. For example: use :func:`sha256`
to create a SHA-256 hash object. You can now feed this object with
:term:`bytes-like objects <bytes-like object>` (normally :class:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
375ae59e-00c9-4821-9cc2-ad04ffc09a4e | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,826 | supabase-export-v2 | 34722ef6bb406c7b | Naive algorithms such as ``sha1(password)`` are not resistant against brute-force attacks. A good password hashing function must be tunable, slow, and include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
.. function:: pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) | trusted_official_docs | CPython Docs | Naive algorithms such as ``sha1(password)`` are not resistant against brute-force attacks. A good password hashing function must be tunable, slow, and include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
.. function:: pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) | Naive algorithms such as ``sha1(password)`` are not resistant against brute-force attacks. A good password hashing function must be tunable, slow, and include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
.. function:: pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4cf49130-c73c-48c8-a8a7-ce8603ca9405 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,820 | supabase-export-v2 | bd2caadc574a010b | >>> import io, hashlib, hmac >>> with open("library/hashlib.rst", "rb") as f: ... digest = hashlib.file_digest(f, "sha256") ... >>> digest.hexdigest() # doctest: +ELLIPSIS '...'
>>> buf = io.BytesIO(b"somedata")
>>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512)
>>> digest = hashlib.file_digest(buf, lambda: mac1) | trusted_official_docs | CPython Docs | >>> import io, hashlib, hmac >>> with open("library/hashlib.rst", "rb") as f: ... digest = hashlib.file_digest(f, "sha256") ... >>> digest.hexdigest() # doctest: +ELLIPSIS '...'
>>> buf = io.BytesIO(b"somedata")
>>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512)
>>> digest = hashlib.file_digest(buf, lambda: mac1) | >>> import io, hashlib, hmac >>> with open("library/hashlib.rst", "rb") as f: ... digest = hashlib.file_digest(f, "sha256") ... >>> digest.hexdigest() # doctest: +ELLIPSIS '...'
>>> buf = io.BytesIO(b"somedata")
>>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512)
>>> digest = hashlib.file_digest(buf, lambda: mac1) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4d885487-22e6-4e66-a8b6-7fe78f03fd5a | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,775 | supabase-export-v2 | f20feb1e4317c26a | usedforsecurity=True) .. function:: sha3_224([, data], *, usedforsecurity=True) .. function:: sha3_256([, data], *, usedforsecurity=True) .. function:: sha3_384([, data], *, usedforsecurity=True) .. function:: sha3_512([, data], *, usedforsecurity=True)
Named constructors such as these are faster than passing an algori... | trusted_official_docs | CPython Docs | usedforsecurity=True) .. function:: sha3_224([, data], *, usedforsecurity=True) .. function:: sha3_256([, data], *, usedforsecurity=True) .. function:: sha3_384([, data], *, usedforsecurity=True) .. function:: sha3_512([, data], *, usedforsecurity=True)
Named constructors such as these are faster than passing an algori... | usedforsecurity=True) .. function:: sha3_224([, data], *, usedforsecurity=True) .. function:: sha3_256([, data], *, usedforsecurity=True) .. function:: sha3_384([, data], *, usedforsecurity=True) .. function:: sha3_512([, data], *, usedforsecurity=True)
Named constructors such as these are faster than passing an algori... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
51408bc9-2e8f-4a3c-a773-c1bab5132e35 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,916 | supabase-export-v2 | 2b98a8c886c733d0 | Personalization together with the keyed mode can also be used to derive different keys from a single one.
>>> from hashlib import blake2s
>>> from base64 import b64decode, b64encode
>>> orig_key = b64decode(b'Rm5EPJai72qcK3RGBpW3vPNfZy5OZothY+kHY6h21KM=')
>>> enc_key = blake2s(key=orig_key, person=b'kEncrypt').diges... | trusted_official_docs | CPython Docs | Personalization together with the keyed mode can also be used to derive different keys from a single one.
>>> from hashlib import blake2s
>>> from base64 import b64decode, b64encode
>>> orig_key = b64decode(b'Rm5EPJai72qcK3RGBpW3vPNfZy5OZothY+kHY6h21KM=')
>>> enc_key = blake2s(key=orig_key, person=b'kEncrypt').diges... | Personalization together with the keyed mode can also be used to derive different keys from a single one.
>>> from hashlib import blake2s
>>> from base64 import b64decode, b64encode
>>> orig_key = b64decode(b'Rm5EPJai72qcK3RGBpW3vPNfZy5OZothY+kHY6h21KM=')
>>> enc_key = blake2s(key=orig_key, person=b'kEncrypt').diges... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53f25256-a11a-4de4-b176-de6404b63911 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,925 | supabase-export-v2 | efd34be678af0d4c | Aumasson*, *Samuel Neves*, *Zooko Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and *Raphael C.-W. Phan*.
It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*. | trusted_official_docs | CPython Docs | Aumasson*, *Samuel Neves*, *Zooko Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and *Raphael C.-W. Phan*.
It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*. | Aumasson*, *Samuel Neves*, *Zooko Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and *Raphael C.-W. Phan*.
It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54774b6a-c36e-4710-8731-5bc27834b150 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,907 | supabase-export-v2 | 71ea6e05b7539264 | .. warning::
*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose
cryptographic hash function, such as SHA-256, is not suitable for hashing
passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more
information. .. | trusted_official_docs | CPython Docs | .. warning::
*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose
cryptographic hash function, such as SHA-256, is not suitable for hashing
passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more
information. .. | .. warning::
*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose
cryptographic hash function, such as SHA-256, is not suitable for hashing
passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more
information. .. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56e37ea6-3d56-40a1-9575-d9b897880e20 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,868 | supabase-export-v2 | 61247aae57d9ed6a | * *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 in sequential mode).
* *last_node*: boolean indicating whether the processed node is the last
one (``False`` for sequential mode). | trusted_official_docs | CPython Docs | * *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 in sequential mode).
* *last_node*: boolean indicating whether the processed node is the last
one (``False`` for sequential mode). | * *inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 in sequential mode).
* *last_node*: boolean indicating whether the processed node is the last
one (``False`` for sequential mode). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5827dc2b-2e47-4f4b-b628-3b52159c988c | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,914 | supabase-export-v2 | 46a54dda925e87ef | BLAKE2 can be personalized by passing bytes to the *person* argument::
>>> from hashlib import blake2b
>>> FILES_HASH_PERSON = b'MyApp Files Hash'
>>> BLOCK_HASH_PERSON = b'MyApp Block Hash'
>>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)
>>> h.update(b'the same content')
>>> h.hexdigest()
'20d9cd024d4f... | trusted_official_docs | CPython Docs | BLAKE2 can be personalized by passing bytes to the *person* argument::
>>> from hashlib import blake2b
>>> FILES_HASH_PERSON = b'MyApp Files Hash'
>>> BLOCK_HASH_PERSON = b'MyApp Block Hash'
>>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)
>>> h.update(b'the same content')
>>> h.hexdigest()
'20d9cd024d4f... | BLAKE2 can be personalized by passing bytes to the *person* argument::
>>> from hashlib import blake2b
>>> FILES_HASH_PERSON = b'MyApp Files Hash'
>>> BLOCK_HASH_PERSON = b'MyApp Block Hash'
>>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)
>>> h.update(b'the same content')
>>> h.hexdigest()
'20d9cd024d4f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5db27dba-6e86-43f3-a153-f51309713871 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,921 | supabase-export-v2 | 2f6af4d16e97af45 | This example uses 64-byte internal digests, and returns the 32-byte final digest::
>>> from hashlib import blake2b
>>>
>>> FANOUT = 2
>>> DEPTH = 2
>>> LEAF_SIZE = 4096
>>> INNER_SIZE = 64
>>>
>>> buf = bytearray(6000)
>>>
>>> # Left leaf
... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,
... le... | trusted_official_docs | CPython Docs | This example uses 64-byte internal digests, and returns the 32-byte final digest::
>>> from hashlib import blake2b
>>>
>>> FANOUT = 2
>>> DEPTH = 2
>>> LEAF_SIZE = 4096
>>> INNER_SIZE = 64
>>>
>>> buf = bytearray(6000)
>>>
>>> # Left leaf
... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,
... le... | This example uses 64-byte internal digests, and returns the 32-byte final digest::
>>> from hashlib import blake2b
>>>
>>> FANOUT = 2
>>> DEPTH = 2
>>> LEAF_SIZE = 4096
>>> INNER_SIZE = 64
>>>
>>> buf = bytearray(6000)
>>>
>>> # Left leaf
... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,
... le... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5fa9014c-14ab-4f00-ac15-8c01e3f1e485 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,763 | supabase-export-v2 | f55a98d33a4f8182 | the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL does not provide we fall back to a verified implementation from the `HACL\* project`_.
.. deprecated-removed:: 3.15 3.19
The undocumented ``string`` keyword parameter in :func:`!_hashlib.new`
and hash-named constructors such as :func:`!_md5.md5` is depre... | trusted_official_docs | CPython Docs | the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL does not provide we fall back to a verified implementation from the `HACL\* project`_.
.. deprecated-removed:: 3.15 3.19
The undocumented ``string`` keyword parameter in :func:`!_hashlib.new`
and hash-named constructors such as :func:`!_md5.md5` is depre... | the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL does not provide we fall back to a verified implementation from the `HACL\* project`_.
.. deprecated-removed:: 3.15 3.19
The undocumented ``string`` keyword parameter in :func:`!_hashlib.new`
and hash-named constructors such as :func:`!_md5.md5` is depre... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60a1fa5b-dd24-49a5-a82d-27792a70c7e6 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,772 | supabase-export-v2 | 22b5d663e346018e | first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer.
Using :func:`new` with an algorithm name: | trusted_official_docs | CPython Docs | first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer.
Using :func:`new` with an algorithm name: | first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer.
Using :func:`new` with an algorithm name: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60b519cb-c3e8-4ba4-a8e4-27a40f19ebdb | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,815 | supabase-export-v2 | b95a0d0f36a5c3c2 | Return a digest object that has been updated with contents of file object.
*fileobj* must be a file-like object opened for reading in binary mode. It accepts file objects from builtin :func:`open`, :class:`~io.BytesIO`
instances, SocketIO objects from :meth:`socket.socket.makefile`, and
similar. *fileobj* must be ope... | trusted_official_docs | CPython Docs | Return a digest object that has been updated with contents of file object.
*fileobj* must be a file-like object opened for reading in binary mode. It accepts file objects from builtin :func:`open`, :class:`~io.BytesIO`
instances, SocketIO objects from :meth:`socket.socket.makefile`, and
similar. *fileobj* must be ope... | Return a digest object that has been updated with contents of file object.
*fileobj* must be a file-like object opened for reading in binary mode. It accepts file objects from builtin :func:`open`, :class:`~io.BytesIO`
instances, SocketIO objects from :meth:`socket.socket.makefile`, and
similar. *fileobj* must be ope... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
64053502-eb14-4dea-9c28-65a9212ae7d5 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,793 | supabase-export-v2 | de7d926437592478 | name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms.
A hash object has the following methods: | trusted_official_docs | CPython Docs | name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms.
A hash object has the following methods: | name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms.
A hash object has the following methods: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
64b31a1e-6148-4ca2-8e3e-7c1d271cd8ab | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,754 | supabase-export-v2 | 75a97ab7ed409b02 | .. index:: single: OpenSSL; (use in module hashlib)
Constructors for hash algorithms that are always present in this module are
:func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`,
:func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`,
:func:`shake_128`, :func:`shake_256`, :fun... | trusted_official_docs | CPython Docs | .. index:: single: OpenSSL; (use in module hashlib)
Constructors for hash algorithms that are always present in this module are
:func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`,
:func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`,
:func:`shake_128`, :func:`shake_256`, :fun... | .. index:: single: OpenSSL; (use in module hashlib)
Constructors for hash algorithms that are always present in this module are
:func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`,
:func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`,
:func:`shake_128`, :func:`shake_256`, :fun... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
687ef73a-60d5-4d26-acff-3fa93b07729c | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,850 | supabase-export-v2 | 59480e1d3c53acdc | .. function:: 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)
These functions return the corresponding hash objects for calculating
BLAKE2b or BLAKE2s. They optionally take these g... | trusted_official_docs | CPython Docs | .. function:: 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)
These functions return the corresponding hash objects for calculating
BLAKE2b or BLAKE2s. They optionally take these g... | .. function:: 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)
These functions return the corresponding hash objects for calculating
BLAKE2b or BLAKE2s. They optionally take these g... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b08e146-595e-4d64-be44-a81acf0bc2af | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,753 | supabase-export-v2 | 5bd4a00e3caac74c | multithreading, the Python :term:`GIL` is released while computing a hash supplied more than 2047 bytes of data at once in its constructor or :meth:`.update<hash.update>` method.
.. index:: single: OpenSSL; (use in module hashlib) | trusted_official_docs | CPython Docs | multithreading, the Python :term:`GIL` is released while computing a hash supplied more than 2047 bytes of data at once in its constructor or :meth:`.update<hash.update>` method.
.. index:: single: OpenSSL; (use in module hashlib) | multithreading, the Python :term:`GIL` is released while computing a hash supplied more than 2047 bytes of data at once in its constructor or :meth:`.update<hash.update>` method.
.. index:: single: OpenSSL; (use in module hashlib) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6c3591a3-fab5-4aab-bf22-5465ec460620 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,829 | supabase-export-v2 | faa90d8e0915cf47 | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
The number of *iterations* should be chosen based on the hash algorithm and
computing power. As of 2022, hundreds of thousands of iterations of SHA-256
are sug... | trusted_official_docs | CPython Docs | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
The number of *iterations* should be chosen based on the hash algorithm and
computing power. As of 2022, hundreds of thousands of iterations of SHA-256
are sug... | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
The number of *iterations* should be chosen based on the hash algorithm and
computing power. As of 2022, hundreds of thousands of iterations of SHA-256
are sug... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6c83f3ae-cd99-4a1d-90b1-ffe5347b806d | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,842 | supabase-export-v2 | 9dbab93c10f8fdee | BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes in two flavors:
* **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size
between 1 and 64 bytes, | trusted_official_docs | CPython Docs | BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes in two flavors:
* **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size
between 1 and 64 bytes, | BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes in two flavors:
* **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size
between 1 and 64 bytes, | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6d78c842-d115-433f-b98a-51ae83f09537 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,758 | supabase-export-v2 | 187139c1de9a6afd | known hash collision weaknesses (including MD5 and SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-seealso`_ section at the end of this document.
.. versionadded:: 3.6
SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`,
:func:`sha3_384`, :func:`sha3_512`, :func:`shake... | trusted_official_docs | CPython Docs | known hash collision weaknesses (including MD5 and SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-seealso`_ section at the end of this document.
.. versionadded:: 3.6
SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`,
:func:`sha3_384`, :func:`sha3_512`, :func:`shake... | known hash collision weaknesses (including MD5 and SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-seealso`_ section at the end of this document.
.. versionadded:: 3.6
SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`,
:func:`sha3_384`, :func:`sha3_512`, :func:`shake... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6e2b7b78-9d38-4f59-93c7-59413591fb7e | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,774 | supabase-export-v2 | 9ee878e0863fe18c | >>> h = hashlib.new('sha256') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() '031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
.. function:: md5([, data], *, usedforsecurity=True)
.. function:: sha1([, data], *, usedforsecurity=True)
.. function:: sha224([, data], *, usedfor... | trusted_official_docs | CPython Docs | >>> h = hashlib.new('sha256') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() '031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
.. function:: md5([, data], *, usedforsecurity=True)
.. function:: sha1([, data], *, usedforsecurity=True)
.. function:: sha224([, data], *, usedfor... | >>> h = hashlib.new('sha256') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() '031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
.. function:: md5([, data], *, usedforsecurity=True)
.. function:: sha1([, data], *, usedforsecurity=True)
.. function:: sha224([, data], *, usedfor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
783f96e2-ad77-48ec-a8aa-4fa6f9081643 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,891 | supabase-export-v2 | ec89029815b08768 | completely different outputs (shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s produce different outputs even if the output length is the same:
>>> from hashlib import blake2b, blake2s
>>> blake2b(digest_size=10).hexdigest()
'6fa1d8fcfd719046d762'
>>> blake2b(digest_size=11).hexdigest()
'eb6... | trusted_official_docs | CPython Docs | completely different outputs (shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s produce different outputs even if the output length is the same:
>>> from hashlib import blake2b, blake2s
>>> blake2b(digest_size=10).hexdigest()
'6fa1d8fcfd719046d762'
>>> blake2b(digest_size=11).hexdigest()
'eb6... | completely different outputs (shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s produce different outputs even if the output length is the same:
>>> from hashlib import blake2b, blake2s
>>> blake2b(digest_size=10).hexdigest()
'6fa1d8fcfd719046d762'
>>> blake2b(digest_size=11).hexdigest()
'eb6... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7c7bc6eb-f304-40c2-bcf2-fbebacd54f24 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,808 | supabase-export-v2 | 6e9779949b57253d | .. method:: shake.hexdigest(length)
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value in email or other non-binary environments. | trusted_official_docs | CPython Docs | .. method:: shake.hexdigest(length)
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value in email or other non-binary environments. | .. method:: shake.hexdigest(length)
Like :meth:`digest` except the digest is returned as a string object of
double length, containing only hexadecimal digits. This may be used to
exchange the value in email or other non-binary environments. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7d11ee82-97db-4b02-acfe-ce76a68a2ca9 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,886 | supabase-export-v2 | ce0ac139b9a59055 | You can call :meth:`hash.update` as many times as you need to iteratively update the hash:
>>> from hashlib import blake2b
>>> items = [b'Hello', b' ', b'world']
>>> h = blake2b()
>>> for item in items:
... h.update(item)
... >>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8... | trusted_official_docs | CPython Docs | You can call :meth:`hash.update` as many times as you need to iteratively update the hash:
>>> from hashlib import blake2b
>>> items = [b'Hello', b' ', b'world']
>>> h = blake2b()
>>> for item in items:
... h.update(item)
... >>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8... | You can call :meth:`hash.update` as many times as you need to iteratively update the hash:
>>> from hashlib import blake2b
>>> items = [b'Hello', b' ', b'world']
>>> h = blake2b()
>>> for item in items:
... h.update(item)
... >>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7fcef0c6-7721-452a-bcf2-4dd18b2a6eeb | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,882 | supabase-export-v2 | aba2b328ae319d82 | the data by calling :meth:`~hash.update` on the object, and, finally, get the digest out of the object by calling :meth:`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string).
>>> from hashlib import blake2b
>>> h = blake2b()
>>> h.update(b'Hello world')
>>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b... | trusted_official_docs | CPython Docs | the data by calling :meth:`~hash.update` on the object, and, finally, get the digest out of the object by calling :meth:`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string).
>>> from hashlib import blake2b
>>> h = blake2b()
>>> h.update(b'Hello world')
>>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b... | the data by calling :meth:`~hash.update` on the object, and, finally, get the digest out of the object by calling :meth:`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string).
>>> from hashlib import blake2b
>>> h = blake2b()
>>> h.update(b'Hello world')
>>> h.hexdigest()
'6ff843ba685842aa82031d3f53c48b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
81cfd8cd-4c34-4198-b15a-649590f5b658 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,857 | supabase-export-v2 | 4e30136d44c08537 | The following table shows limits for general parameters (in bytes):
======= =========== ======== ========= ===========
Hash digest_size len(key) len(salt) len(person)
======= =========== ======== ========= ===========
BLAKE2b 64 64 16 16
BLAKE2s 32 32 8 8
======= =========== ======== ========= =========== | trusted_official_docs | CPython Docs | The following table shows limits for general parameters (in bytes):
======= =========== ======== ========= ===========
Hash digest_size len(key) len(salt) len(person)
======= =========== ======== ========= ===========
BLAKE2b 64 64 16 16
BLAKE2s 32 32 8 8
======= =========== ======== ========= =========== | The following table shows limits for general parameters (in bytes):
======= =========== ======== ========= ===========
Hash digest_size len(key) len(salt) len(person)
======= =========== ======== ========= ===========
BLAKE2b 64 64 16 16
BLAKE2s 32 32 8 8
======= =========== ======== ========= =========== | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
82fba119-6abe-4de8-931d-249e016031ad | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,894 | supabase-export-v2 | dce0d33169aa262b | simpler replacement for `Hash-based message authentication code <https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the indifferentiability property inherited from BLAKE.
This example shows how to get a (hex-encoded) 128-bit authentication code for
message ``b'message... | trusted_official_docs | CPython Docs | simpler replacement for `Hash-based message authentication code <https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the indifferentiability property inherited from BLAKE.
This example shows how to get a (hex-encoded) 128-bit authentication code for
message ``b'message... | simpler replacement for `Hash-based message authentication code <https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the indifferentiability property inherited from BLAKE.
This example shows how to get a (hex-encoded) 128-bit authentication code for
message ``b'message... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8460c74b-9c62-4a60-b200-b7bba35e94d2 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,835 | supabase-export-v2 | b6d5373c0af4d7a1 | .. versionchanged:: 3.12 Function now only available when Python is built with OpenSSL. The slow pure Python implementation has been removed.
.. function:: scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64) | trusted_official_docs | CPython Docs | .. versionchanged:: 3.12 Function now only available when Python is built with OpenSSL. The slow pure Python implementation has been removed.
.. function:: scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64) | .. versionchanged:: 3.12 Function now only available when Python is built with OpenSSL. The slow pure Python implementation has been removed.
.. function:: scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
86976ab8-d8a9-4113-ab0c-fbd32b832176 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,828 | supabase-export-v2 | 3bf9a7b5b67b572a | The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function.
The string *hash_name* is the desired name of the hash digest algorithm for
HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as
buffers of bytes. Applications and libraries should limit *p... | trusted_official_docs | CPython Docs | The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function.
The string *hash_name* is the desired name of the hash digest algorithm for
HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as
buffers of bytes. Applications and libraries should limit *p... | The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function.
The string *hash_name* is the desired name of the hash digest algorithm for
HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as
buffers of bytes. Applications and libraries should limit *p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88d3f8b7-05ee-4f18-9e8e-a17251fd5bdf | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,762 | supabase-export-v2 | 25057e5a11a83c27 | .. versionchanged:: 3.9 Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it.
.. versionchanged:: 3.12
For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked
OpenSSL does not provide we fall back to a verified implementation from
the `HACL\* project`_. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.9 Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it.
.. versionchanged:: 3.12
For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked
OpenSSL does not provide we fall back to a verified implementation from
the `HACL\* project`_. | .. versionchanged:: 3.9 Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it.
.. versionchanged:: 3.12
For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked
OpenSSL does not provide we fall back to a verified implementation from
the `HACL\* project`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8a69dd85-c736-4936-8a5a-2d4998292f44 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,851 | supabase-export-v2 | 2907a7b9146e103a | These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters:
* *data*: initial chunk of data to hash, which must be
:term:`bytes-like object`. It can be passed only as positional argument. | trusted_official_docs | CPython Docs | These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters:
* *data*: initial chunk of data to hash, which must be
:term:`bytes-like object`. It can be passed only as positional argument. | These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters:
* *data*: initial chunk of data to hash, which must be
:term:`bytes-like object`. It can be passed only as positional argument. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8baec7c0-46f4-4efe-9f1d-e963d0e65fb7 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,924 | supabase-export-v2 | a071b11ab78d92ab | Credits ^^^^^^^
BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko
Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_
created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and
*Raphael C.-W. Phan*. | trusted_official_docs | CPython Docs | Credits ^^^^^^^
BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko
Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_
created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and
*Raphael C.-W. Phan*. | Credits ^^^^^^^
BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko
Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_
created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and
*Raphael C.-W. Phan*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9bf03f2b-5a44-48ed-b803-b781deb0ee74 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,866 | supabase-export-v2 | 10e4a83a557584c4 | * *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).
* *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode). | trusted_official_docs | CPython Docs | * *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).
* *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode). | * *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).
* *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9de6e1ce-3657-4a13-b4f2-601be319c356 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,897 | supabase-export-v2 | f60d2911a1a568a7 | As a practical example, a web application can symmetrically sign cookies sent to users and later verify them to make sure they weren't tampered with::
>>> from hashlib import blake2b
>>> from hmac import compare_digest
>>>
>>> SECRET_KEY = b'pseudorandomly generated server secret key'
>>> AUTH_SIZE = 16
>>>
>>> d... | trusted_official_docs | CPython Docs | As a practical example, a web application can symmetrically sign cookies sent to users and later verify them to make sure they weren't tampered with::
>>> from hashlib import blake2b
>>> from hmac import compare_digest
>>>
>>> SECRET_KEY = b'pseudorandomly generated server secret key'
>>> AUTH_SIZE = 16
>>>
>>> d... | As a practical example, a web application can symmetrically sign cookies sent to users and later verify them to make sure they weren't tampered with::
>>> from hashlib import blake2b
>>> from hmac import compare_digest
>>>
>>> SECRET_KEY = b'pseudorandomly generated server secret key'
>>> AUTH_SIZE = 16
>>>
>>> d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e680e98-8a3f-4a16-accd-2722117eb0f8 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,844 | supabase-export-v2 | a17d7ace5b988388 | * **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any size between 1 and 32 bytes.
BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_),
**salted hashing**, **personalization**, and **tree hashing**. | trusted_official_docs | CPython Docs | * **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any size between 1 and 32 bytes.
BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_),
**salted hashing**, **personalization**, and **tree hashing**. | * **BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any size between 1 and 32 bytes.
BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_),
**salted hashing**, **personalization**, and **tree hashing**. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a1625a1f-a291-4181-924a-af82739ac4a0 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,922 | supabase-export-v2 | af5c89913c28558c | = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ... node_offset=1, node_depth=0, last_node=True) >>> # Root node ... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ...
node_offset=0, node_depth=1, last_node... | trusted_official_docs | CPython Docs | = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ... node_offset=1, node_depth=0, last_node=True) >>> # Root node ... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ...
node_offset=0, node_depth=1, last_node... | = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ... node_offset=1, node_depth=0, last_node=True) >>> # Root node ... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH, ... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE, ...
node_offset=0, node_depth=1, last_node... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a28825f8-de1e-4d8f-bbca-916a092dea80 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,854 | supabase-export-v2 | d54fae1d4e291598 | * *key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for BLAKE2s).
* *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8
bytes for BLAKE2s). | trusted_official_docs | CPython Docs | * *key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for BLAKE2s).
* *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8
bytes for BLAKE2s). | * *key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for BLAKE2s).
* *salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8
bytes for BLAKE2s). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a5e8af38-9fee-4ca8-ac44-f3affa484e76 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,901 | supabase-export-v2 | ddf2dc24b39fb1ea | Randomized hashing """"""""""""""""""
By setting *salt* parameter users can introduce randomization to the hash
function. Randomized hashing is useful for protecting against collision attacks
on the hash function used in digital signatures. | trusted_official_docs | CPython Docs | Randomized hashing """"""""""""""""""
By setting *salt* parameter users can introduce randomization to the hash
function. Randomized hashing is useful for protecting against collision attacks
on the hash function used in digital signatures. | Randomized hashing """"""""""""""""""
By setting *salt* parameter users can introduce randomization to the hash
function. Randomized hashing is useful for protecting against collision attacks
on the hash function used in digital signatures. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a9e8bb12-488a-4a0c-9b96-76218b1278d0 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,902 | supabase-export-v2 | 2fd952ab169714ec | users can introduce randomization to the hash function. Randomized hashing is useful for protecting against collision attacks on the hash function used in digital signatures.
Randomized hashing is designed for situations where one party, the message
preparer, generates all or part of a message to be signed by a second... | trusted_official_docs | CPython Docs | users can introduce randomization to the hash function. Randomized hashing is useful for protecting against collision attacks on the hash function used in digital signatures.
Randomized hashing is designed for situations where one party, the message
preparer, generates all or part of a message to be signed by a second... | users can introduce randomization to the hash function. Randomized hashing is useful for protecting against collision attacks on the hash function used in digital signatures.
Randomized hashing is designed for situations where one party, the message
preparer, generates all or part of a message to be signed by a second... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ab4424b4-ea38-424e-87ab-85ab9ba376a2 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,821 | supabase-export-v2 | d5f9c2163804650d | >>> buf = io.BytesIO(b"somedata") >>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512) >>> digest = hashlib.file_digest(buf, lambda: mac1)
>>> digest is mac1
True
>>> mac2 = hmac.HMAC(b"key", b"somedata", digestmod=hashlib.sha512)
>>> mac1.digest() == mac2.digest()
True | trusted_official_docs | CPython Docs | >>> buf = io.BytesIO(b"somedata") >>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512) >>> digest = hashlib.file_digest(buf, lambda: mac1)
>>> digest is mac1
True
>>> mac2 = hmac.HMAC(b"key", b"somedata", digestmod=hashlib.sha512)
>>> mac1.digest() == mac2.digest()
True | >>> buf = io.BytesIO(b"somedata") >>> mac1 = hmac.HMAC(b"key", digestmod=hashlib.sha512) >>> digest = hashlib.file_digest(buf, lambda: mac1)
>>> digest is mac1
True
>>> mac2 = hmac.HMAC(b"key", b"somedata", digestmod=hashlib.sha512)
>>> mac1.digest() == mac2.digest()
True | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aefb3658-579a-475f-8a0d-0a17b046f3f9 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,760 | supabase-export-v2 | 1a8c6468b4b3526d | .. _hashlib-usedforsecurity:
.. versionchanged:: 3.9
All hashlib constructors take a keyword-only argument *usedforsecurity*
with default value ``True``. A false value allows the use of insecure and
blocked hashing algorithms in restricted environments. ``False`` indicates
that the hashing algorithm is not used in ... | trusted_official_docs | CPython Docs | .. _hashlib-usedforsecurity:
.. versionchanged:: 3.9
All hashlib constructors take a keyword-only argument *usedforsecurity*
with default value ``True``. A false value allows the use of insecure and
blocked hashing algorithms in restricted environments. ``False`` indicates
that the hashing algorithm is not used in ... | .. _hashlib-usedforsecurity:
.. versionchanged:: 3.9
All hashlib constructors take a keyword-only argument *usedforsecurity*
with default value ``True``. A false value allows the use of insecure and
blocked hashing algorithms in restricted environments. ``False`` indicates
that the hashing algorithm is not used in ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b02f7baa-dccc-406d-bdfd-1fa9cc7027fb | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,898 | supabase-export-v2 | 552db75f67062741 | >>> >>> cookie = b'user-alice' >>> sig = sign(cookie) >>> print("{0},{1}".format(cookie.decode('utf-8'), sig)) user-alice,b'43b3c982cf697e0c5ab22172d1ca7421' >>> verify(cookie, sig) True >>> verify(b'user-bob', sig) False >>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00') False
Even though there's a native keyed h... | trusted_official_docs | CPython Docs | >>> >>> cookie = b'user-alice' >>> sig = sign(cookie) >>> print("{0},{1}".format(cookie.decode('utf-8'), sig)) user-alice,b'43b3c982cf697e0c5ab22172d1ca7421' >>> verify(cookie, sig) True >>> verify(b'user-bob', sig) False >>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00') False
Even though there's a native keyed h... | >>> >>> cookie = b'user-alice' >>> sig = sign(cookie) >>> print("{0},{1}".format(cookie.decode('utf-8'), sig)) user-alice,b'43b3c982cf697e0c5ab22172d1ca7421' >>> verify(cookie, sig) True >>> verify(b'user-bob', sig) False >>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00') False
Even though there's a native keyed h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0bb9e51-2ed6-4ce1-b6e7-e9824ab68e39 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,859 | supabase-export-v2 | ce0ce50941c36100 | .. note::
BLAKE2 specification defines constant lengths for salt and personalization
parameters, however, for convenience, this implementation accepts byte
strings of any size up to the specified length. If the length of the
parameter is less than specified, it is padded with zeros, thus, for
example, ``b'salt'`` a... | trusted_official_docs | CPython Docs | .. note::
BLAKE2 specification defines constant lengths for salt and personalization
parameters, however, for convenience, this implementation accepts byte
strings of any size up to the specified length. If the length of the
parameter is less than specified, it is padded with zeros, thus, for
example, ``b'salt'`` a... | .. note::
BLAKE2 specification defines constant lengths for salt and personalization
parameters, however, for convenience, this implementation accepts byte
strings of any size up to the specified length. If the length of the
parameter is less than specified, it is padded with zeros, thus, for
example, ``b'salt'`` a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b102903f-ad4a-450d-aedc-ed74e0ce3e0f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,761 | supabase-export-v2 | 34386e43f7ccdb8f | hashing algorithms in restricted environments. ``False`` indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function.
.. versionchanged:: 3.9
Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it. | trusted_official_docs | CPython Docs | hashing algorithms in restricted environments. ``False`` indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function.
.. versionchanged:: 3.9
Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it. | hashing algorithms in restricted environments. ``False`` indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function.
.. versionchanged:: 3.9
Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3c64ce5-4163-4bd4-b357-148e18c67dec | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,837 | supabase-export-v2 | de9873dc9337a41d | The function provides scrypt password-based key derivation function as defined in :rfc:`7914`.
*password* and *salt* must be :term:`bytes-like objects
<bytes-like object>`. Applications and libraries should limit *password*
to a sensible length (e.g. 1024). *salt* should be about 16 or more
bytes from a proper sourc... | trusted_official_docs | CPython Docs | The function provides scrypt password-based key derivation function as defined in :rfc:`7914`.
*password* and *salt* must be :term:`bytes-like objects
<bytes-like object>`. Applications and libraries should limit *password*
to a sensible length (e.g. 1024). *salt* should be about 16 or more
bytes from a proper sourc... | The function provides scrypt password-based key derivation function as defined in :rfc:`7914`.
*password* and *salt* must be :term:`bytes-like objects
<bytes-like object>`. Applications and libraries should limit *password*
to a sensible length (e.g. 1024). *salt* should be about 16 or more
bytes from a proper sourc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b5d09b75-5e41-4561-aa93-2dcd0d57a4d9 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,864 | supabase-export-v2 | a716744aadd962f9 | * *depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential mode).
* *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in
sequential mode). | trusted_official_docs | CPython Docs | * *depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential mode).
* *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in
sequential mode). | * *depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential mode).
* *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in
sequential mode). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6436c4a-221c-4178-8293-5fc6c2f7a96a | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,927 | supabase-export-v2 | 947e7165e964346a | It was written by *Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*.
The C code was partly rewritten for Python by *Christian Heimes*. | trusted_official_docs | CPython Docs | It was written by *Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*.
The C code was partly rewritten for Python by *Christian Heimes*. | It was written by *Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*.
The C code was partly rewritten for Python by *Christian Heimes*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b670a9a2-ed27-4f2a-9961-a7912ea5e02f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,830 | supabase-export-v2 | 3c555da3e900b2ca | how to choose what is best for your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on the `stackexchange pbkdf2 iterations question`_ explain in detail.
*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the
digest size of the hash algorithm *hash_name* is used, e.g. 64... | trusted_official_docs | CPython Docs | how to choose what is best for your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on the `stackexchange pbkdf2 iterations question`_ explain in detail.
*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the
digest size of the hash algorithm *hash_name* is used, e.g. 64... | how to choose what is best for your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on the `stackexchange pbkdf2 iterations question`_ explain in detail.
*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the
digest size of the hash algorithm *hash_name* is used, e.g. 64... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b806442b-656f-4d9e-86ae-9574ed4e58d0 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,797 | supabase-export-v2 | 2c19c772a558ec6b | .. method:: hash.digest()
Return the digest of the data passed to the :meth:`update` method so far. This is a bytes object of size :attr:`digest_size` which may contain bytes in
the whole range from 0 to 255. | trusted_official_docs | CPython Docs | .. method:: hash.digest()
Return the digest of the data passed to the :meth:`update` method so far. This is a bytes object of size :attr:`digest_size` which may contain bytes in
the whole range from 0 to 255. | .. method:: hash.digest()
Return the digest of the data passed to the :meth:`update` method so far. This is a bytes object of size :attr:`digest_size` which may contain bytes in
the whole range from 0 to 255. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bae1051f-39da-4a1c-90c5-4180027e0ee4 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,883 | supabase-export-v2 | dc5fa44a5290a590 | >>> from hashlib import blake2b >>> h = blake2b() >>> h.update(b'Hello world') >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
As a shortcut, you can pass the first chunk of data to update directly to the
constructor as... | trusted_official_docs | CPython Docs | >>> from hashlib import blake2b >>> h = blake2b() >>> h.update(b'Hello world') >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
As a shortcut, you can pass the first chunk of data to update directly to the
constructor as... | >>> from hashlib import blake2b >>> h = blake2b() >>> h.update(b'Hello world') >>> h.hexdigest() '6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'
As a shortcut, you can pass the first chunk of data to update directly to the
constructor as... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bedd5f2c-57de-4084-93c9-8023a5982463 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,915 | supabase-export-v2 | e96e8235bf046b46 | Hash' >>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() '20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4' >>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() 'cf68fb5761b9c44e7878bfb2c4... | trusted_official_docs | CPython Docs | Hash' >>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() '20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4' >>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() 'cf68fb5761b9c44e7878bfb2c4... | Hash' >>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() '20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4' >>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON) >>> h.update(b'the same content') >>> h.hexdigest() 'cf68fb5761b9c44e7878bfb2c4... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0531074-2956-4000-9773-37ec6f23bc0d | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,817 | supabase-export-v2 | 544c6f46a8287061 | *fileobj* must be assumed to be in an unknown state after this function returns or raises. It is up to the caller to close *fileobj*.
*digest* must either be a hash algorithm name as a *str*, a hash
constructor, or a callable that returns a hash object. | trusted_official_docs | CPython Docs | *fileobj* must be assumed to be in an unknown state after this function returns or raises. It is up to the caller to close *fileobj*.
*digest* must either be a hash algorithm name as a *str*, a hash
constructor, or a callable that returns a hash object. | *fileobj* must be assumed to be in an unknown state after this function returns or raises. It is up to the caller to close *fileobj*.
*digest* must either be a hash algorithm name as a *str*, a hash
constructor, or a callable that returns a hash object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c45c73e8-7352-401e-aa4e-cb40f40ac1b9 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,849 | supabase-export-v2 | 86181b07c226cb4d | .. function:: 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)
.. function:: blake2s(data=b'', *, digest_size=32, key=b'', salt=b'', \
person=b'', fanout=1, depth=1, leaf_size=0, n... | trusted_official_docs | CPython Docs | .. function:: 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)
.. function:: blake2s(data=b'', *, digest_size=32, key=b'', salt=b'', \
person=b'', fanout=1, depth=1, leaf_size=0, n... | .. function:: 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)
.. function:: blake2s(data=b'', *, digest_size=32, key=b'', salt=b'', \
person=b'', fanout=1, depth=1, leaf_size=0, n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c5b319ce-a54e-4982-ae4c-9a4ab9f7f7fa | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,911 | supabase-export-v2 | c6c0ff9b919aaaf1 | is useful to force hash function to produce different digests for the same input for different purposes. Quoting the authors of the Skein hash function:
We recommend that all application designers seriously consider doing this;
we have seen many protocols where a hash that is computed in one part of
the protocol can ... | trusted_official_docs | CPython Docs | is useful to force hash function to produce different digests for the same input for different purposes. Quoting the authors of the Skein hash function:
We recommend that all application designers seriously consider doing this;
we have seen many protocols where a hash that is computed in one part of
the protocol can ... | is useful to force hash function to produce different digests for the same input for different purposes. Quoting the authors of the Skein hash function:
We recommend that all application designers seriously consider doing this;
we have seen many protocols where a hash that is computed in one part of
the protocol can ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ccbc65d5-9d01-48ce-9105-53e308c4421e | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,792 | supabase-export-v2 | e47629d11dba5e40 | The canonical name of this hash, always lowercase and always suitable as a parameter to :func:`new` to create another hash of this type.
.. versionchanged:: 3.4
The name attribute has been present in CPython since its inception, but
until Python 3.4 was not formally specified, so may not exist on some
platforms. | trusted_official_docs | CPython Docs | The canonical name of this hash, always lowercase and always suitable as a parameter to :func:`new` to create another hash of this type.
.. versionchanged:: 3.4
The name attribute has been present in CPython since its inception, but
until Python 3.4 was not formally specified, so may not exist on some
platforms. | The canonical name of this hash, always lowercase and always suitable as a parameter to :func:`new` to create another hash of this type.
.. versionchanged:: 3.4
The name attribute has been present in CPython since its inception, but
until Python 3.4 was not formally specified, so may not exist on some
platforms. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce3b8f97-9283-4065-ba61-5c01cce23b9b | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,845 | supabase-export-v2 | 5a8e8ff441496e50 | BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), **salted hashing**, **personalization**, and **tree hashing**.
Hash objects from this module follow the API of standard library's
:mod:`!hashlib` objects. | trusted_official_docs | CPython Docs | BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), **salted hashing**, **personalization**, and **tree hashing**.
Hash objects from this module follow the API of standard library's
:mod:`!hashlib` objects. | BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), **salted hashing**, **personalization**, and **tree hashing**.
Hash objects from this module follow the API of standard library's
:mod:`!hashlib` objects. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d0663d8f-ca26-4b7b-9845-b1b5cc026546 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,804 | supabase-export-v2 | 2f128f355cff0b8a | .. function:: shake_128([, data], *, usedforsecurity=True) .. function:: shake_256([, data], *, usedforsecurity=True)
The :func:`shake_128` and :func:`shake_256` algorithms provide variable
length digests with length_in_bits//2 up to 128 or 256 bits of security. As such, their digest methods require a length. Maximum l... | trusted_official_docs | CPython Docs | .. function:: shake_128([, data], *, usedforsecurity=True) .. function:: shake_256([, data], *, usedforsecurity=True)
The :func:`shake_128` and :func:`shake_256` algorithms provide variable
length digests with length_in_bits//2 up to 128 or 256 bits of security. As such, their digest methods require a length. Maximum l... | .. function:: shake_128([, data], *, usedforsecurity=True) .. function:: shake_256([, data], *, usedforsecurity=True)
The :func:`shake_128` and :func:`shake_256` algorithms provide variable
length digests with length_in_bits//2 up to 128 or 256 bits of security. As such, their digest methods require a length. Maximum l... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d12f54fa-a60f-4789-a6b3-d6f86cd21d02 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,888 | supabase-export-v2 | a5ece360bf80528f | Using different digest sizes """"""""""""""""""""""""""""
BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to 32
bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing
the size of output, we can tell BLAKE2b to produce 20-byte digests: | trusted_official_docs | CPython Docs | Using different digest sizes """"""""""""""""""""""""""""
BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to 32
bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing
the size of output, we can tell BLAKE2b to produce 20-byte digests: | Using different digest sizes """"""""""""""""""""""""""""
BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to 32
bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing
the size of output, we can tell BLAKE2b to produce 20-byte digests: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d1fe8184-8f18-466f-aa53-3dcfdf2bb59c | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,926 | supabase-export-v2 | 3af04d97bafe4ec8 | It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*.
The stdlib implementation is based on pyblake2_ module. It was written by
*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The
documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*. | trusted_official_docs | CPython Docs | It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*.
The stdlib implementation is based on pyblake2_ module. It was written by
*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The
documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*. | It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*.
The stdlib implementation is based on pyblake2_ module. It was written by
*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The
documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d530d254-37ef-4272-a0b3-091bb1f484e4 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,893 | supabase-export-v2 | dee95d1a2267c533 | Keyed hashing """""""""""""
Keyed hashing can be used for authentication as a faster and simpler
replacement for `Hash-based message authentication code
<https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the
indifferentiability property inherited from BLAKE. | trusted_official_docs | CPython Docs | Keyed hashing """""""""""""
Keyed hashing can be used for authentication as a faster and simpler
replacement for `Hash-based message authentication code
<https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the
indifferentiability property inherited from BLAKE. | Keyed hashing """""""""""""
Keyed hashing can be used for authentication as a faster and simpler
replacement for `Hash-based message authentication code
<https://en.wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the
indifferentiability property inherited from BLAKE. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
deb2fc37-db2c-463f-958b-6fbed0ba7c66 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,757 | supabase-export-v2 | 63683403ac97697d | .. warning::
Some algorithms have known hash collision weaknesses (including MD5 and
SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the
`hashlib-seealso`_ section at the end of this document. | trusted_official_docs | CPython Docs | .. warning::
Some algorithms have known hash collision weaknesses (including MD5 and
SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the
`hashlib-seealso`_ section at the end of this document. | .. warning::
Some algorithms have known hash collision weaknesses (including MD5 and
SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the
`hashlib-seealso`_ section at the end of this document. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4987825-78ae-4bfd-bce7-65b363af6a70 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,929 | supabase-export-v2 | fa3ab1a7d7c2e57d | The following public domain dedication applies for both C hash function implementation, extension code, and this documentation:
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed ... | trusted_official_docs | CPython Docs | The following public domain dedication applies for both C hash function implementation, extension code, and this documentation:
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed ... | The following public domain dedication applies for both C hash function implementation, extension code, and this documentation:
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4b1a6ca-f4f7-4103-9301-b7c7f5606bfb | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,860 | supabase-export-v2 | bbadcd7ee7f20510 | less than specified, it is padded with zeros, thus, for example, ``b'salt'`` and ``b'salt\x00'`` is the same value. (This is not the case for *key*.)
These sizes are available as module `constants`_ described below. | trusted_official_docs | CPython Docs | less than specified, it is padded with zeros, thus, for example, ``b'salt'`` and ``b'salt\x00'`` is the same value. (This is not the case for *key*.)
These sizes are available as module `constants`_ described below. | less than specified, it is padded with zeros, thus, for example, ``b'salt'`` and ``b'salt\x00'`` is the same value. (This is not the case for *key*.)
These sizes are available as module `constants`_ described below. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e768fd7e-7697-4ad5-a17f-d41924a30012 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,889 | supabase-export-v2 | fc9f03672f881592 | 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing the size of output, we can tell BLAKE2b to produce 20-byte digests:
>>> from hashlib import blake2b
>>> h = blake2b(digest_size=20)
>>> h.update(b'Replacing SHA1 with the more secure function')
>>> h.hexdigest()
'd24f26cf8de66472d58d4... | trusted_official_docs | CPython Docs | 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing the size of output, we can tell BLAKE2b to produce 20-byte digests:
>>> from hashlib import blake2b
>>> h = blake2b(digest_size=20)
>>> h.update(b'Replacing SHA1 with the more secure function')
>>> h.hexdigest()
'd24f26cf8de66472d58d4... | 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing the size of output, we can tell BLAKE2b to produce 20-byte digests:
>>> from hashlib import blake2b
>>> h = blake2b(digest_size=20)
>>> h.update(b'Replacing SHA1 with the more secure function')
>>> h.hexdigest()
'd24f26cf8de66472d58d4... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e85ead25-fac7-44ee-b059-138e164d922e | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,895 | supabase-export-v2 | 576e29b80473d9cc | This example shows how to get a (hex-encoded) 128-bit authentication code for message ``b'message data'`` with key ``b'pseudorandom key'``::
>>> from hashlib import blake2b
>>> h = blake2b(key=b'pseudorandom key', digest_size=16)
>>> h.update(b'message data')
>>> h.hexdigest()
'3d363ff7401e02026f4a4687d4863ced' | trusted_official_docs | CPython Docs | This example shows how to get a (hex-encoded) 128-bit authentication code for message ``b'message data'`` with key ``b'pseudorandom key'``::
>>> from hashlib import blake2b
>>> h = blake2b(key=b'pseudorandom key', digest_size=16)
>>> h.update(b'message data')
>>> h.hexdigest()
'3d363ff7401e02026f4a4687d4863ced' | This example shows how to get a (hex-encoded) 128-bit authentication code for message ``b'message data'`` with key ``b'pseudorandom key'``::
>>> from hashlib import blake2b
>>> h = blake2b(key=b'pseudorandom key', digest_size=16)
>>> h.update(b'message data')
>>> h.hexdigest()
'3d363ff7401e02026f4a4687d4863ced' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea553337-c255-4df9-aa8d-17b8fee99da0 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,930 | supabase-export-v2 | fd1236451d30db9c | author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along
with this software. If not, see
https://creativecommons.org/publicdoma... | trusted_official_docs | CPython Docs | author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along
with this software. If not, see
https://creativecommons.org/publicdoma... | author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along
with this software. If not, see
https://creativecommons.org/publicdoma... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea90aa06-fdac-4857-8237-5c9ced595c3b | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,831 | supabase-export-v2 | 6a8e19c50566a541 | of the derived key in bytes. If *dklen* is ``None`` then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
>>> from hashlib import pbkdf2_hmac
>>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters)
>>> d... | trusted_official_docs | CPython Docs | of the derived key in bytes. If *dklen* is ``None`` then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
>>> from hashlib import pbkdf2_hmac
>>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters)
>>> d... | of the derived key in bytes. If *dklen* is ``None`` then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
>>> from hashlib import pbkdf2_hmac
>>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters)
>>> d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eabf9444-d1c0-4c7b-b3f8-2f426ccbc00e | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,934 | supabase-export-v2 | 6c34dec52c3ede09 | _stackexchange pbkdf2 iterations question: https://security.stackexchange.com/questions/3959/recommended-of-iterations-when-using-pbkdf2-sha256/ .. _Attacks on cryptographic hash algorithms: https://en.wikipedia.org/wiki/Cryptographic_hash_function#Attacks_on_cryptographic_hash_algorithms .. _the FIPS 180-4 standard: h... | trusted_official_docs | CPython Docs | _stackexchange pbkdf2 iterations question: https://security.stackexchange.com/questions/3959/recommended-of-iterations-when-using-pbkdf2-sha256/ .. _Attacks on cryptographic hash algorithms: https://en.wikipedia.org/wiki/Cryptographic_hash_function#Attacks_on_cryptographic_hash_algorithms .. _the FIPS 180-4 standard: h... | _stackexchange pbkdf2 iterations question: https://security.stackexchange.com/questions/3959/recommended-of-iterations-when-using-pbkdf2-sha256/ .. _Attacks on cryptographic hash algorithms: https://en.wikipedia.org/wiki/Cryptographic_hash_function#Attacks_on_cryptographic_hash_algorithms .. _the FIPS 180-4 standard: h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb13e1a9-565c-42f7-8159-4350af5821d4 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,838 | supabase-export-v2 | 9602f21d41064aa7 | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the ... | trusted_official_docs | CPython Docs | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the ... | and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb9e2291-a18b-48bd-af45-ada98695e796 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,896 | supabase-export-v2 | fd867b4dfa1c5475 | >>> from hashlib import blake2b >>> h = blake2b(key=b'pseudorandom key', digest_size=16) >>> h.update(b'message data') >>> h.hexdigest() '3d363ff7401e02026f4a4687d4863ced'
As a practical example, a web application can symmetrically sign cookies sent
to users and later verify them to make sure they weren't tampered with... | trusted_official_docs | CPython Docs | >>> from hashlib import blake2b >>> h = blake2b(key=b'pseudorandom key', digest_size=16) >>> h.update(b'message data') >>> h.hexdigest() '3d363ff7401e02026f4a4687d4863ced'
As a practical example, a web application can symmetrically sign cookies sent
to users and later verify them to make sure they weren't tampered with... | >>> from hashlib import blake2b >>> h = blake2b(key=b'pseudorandom key', digest_size=16) >>> h.update(b'message data') >>> h.hexdigest() '3d363ff7401e02026f4a4687d4863ced'
As a practical example, a web application can symmetrically sign cookies sent
to users and later verify them to make sure they weren't tampered with... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec6ad95e-9a68-4417-9508-77d072ee2331 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,908 | supabase-export-v2 | 305134deecb9efa0 | BLAKE2 or any other general-purpose cryptographic hash function, such as SHA-256, is not suitable for hashing passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more information. ..
>>> import os
>>> from hashlib import blake2b
>>> msg = b'some message'
>>> # Calculate the first hash with a random salt. >... | trusted_official_docs | CPython Docs | BLAKE2 or any other general-purpose cryptographic hash function, such as SHA-256, is not suitable for hashing passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more information. ..
>>> import os
>>> from hashlib import blake2b
>>> msg = b'some message'
>>> # Calculate the first hash with a random salt. >... | BLAKE2 or any other general-purpose cryptographic hash function, such as SHA-256, is not suitable for hashing passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more information. ..
>>> import os
>>> from hashlib import blake2b
>>> msg = b'some message'
>>> # Calculate the first hash with a random salt. >... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f12a71f7-d68a-4e87-b766-e389c208cd2f | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,912 | supabase-export-v2 | 1ca303376b9685a3 | can force the application to make the hash inputs the same. Personalizing each hash function used in the protocol summarily stops this type of attack.
(`The Skein Hash Function Family
<https://www.schneier.com/wp-content/uploads/2016/02/skein.pdf>`_,
p. 21) | trusted_official_docs | CPython Docs | can force the application to make the hash inputs the same. Personalizing each hash function used in the protocol summarily stops this type of attack.
(`The Skein Hash Function Family
<https://www.schneier.com/wp-content/uploads/2016/02/skein.pdf>`_,
p. 21) | can force the application to make the hash inputs the same. Personalizing each hash function used in the protocol summarily stops this type of attack.
(`The Skein Hash Function Family
<https://www.schneier.com/wp-content/uploads/2016/02/skein.pdf>`_,
p. 21) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f59b9d41-1f79-4c55-9973-eef4aa4706f2 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,905 | supabase-export-v2 | cd8b6d8d8db27335 | (`NIST SP-800-106 "Randomized Hashing for Digital Signatures" <https://csrc.nist.gov/pubs/sp/800/106/final>`_)
In BLAKE2 the salt is processed as a one-time input to the hash function during
initialization, rather than as an input to each compression function. | trusted_official_docs | CPython Docs | (`NIST SP-800-106 "Randomized Hashing for Digital Signatures" <https://csrc.nist.gov/pubs/sp/800/106/final>`_)
In BLAKE2 the salt is processed as a one-time input to the hash function during
initialization, rather than as an input to each compression function. | (`NIST SP-800-106 "Randomized Hashing for Digital Signatures" <https://csrc.nist.gov/pubs/sp/800/106/final>`_)
In BLAKE2 the salt is processed as a one-time input to the hash function during
initialization, rather than as an input to each compression function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f63ee05d-d9f1-406f-86c8-4a1e25756ac3 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,890 | supabase-export-v2 | 178f4f52accafad4 | from hashlib import blake2b >>> h = blake2b(digest_size=20) >>> h.update(b'Replacing SHA1 with the more secure function') >>> h.hexdigest() 'd24f26cf8de66472d58d4e1b1774b4c9158b1f4c' >>> h.digest_size 20 >>> len(h.digest()) 20
Hash objects with different digest sizes have completely different outputs
(shorter hashes ar... | trusted_official_docs | CPython Docs | from hashlib import blake2b >>> h = blake2b(digest_size=20) >>> h.update(b'Replacing SHA1 with the more secure function') >>> h.hexdigest() 'd24f26cf8de66472d58d4e1b1774b4c9158b1f4c' >>> h.digest_size 20 >>> len(h.digest()) 20
Hash objects with different digest sizes have completely different outputs
(shorter hashes ar... | from hashlib import blake2b >>> h = blake2b(digest_size=20) >>> h.update(b'Replacing SHA1 with the more secure function') >>> h.hexdigest() 'd24f26cf8de66472d58d4e1b1774b4c9158b1f4c' >>> h.digest_size 20 >>> len(h.digest()) 20
Hash objects with different digest sizes have completely different outputs
(shorter hashes ar... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f92b1e2d-88bf-4fdf-8a73-4e58d73b2302 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,832 | supabase-export-v2 | cd60233ad4b97b19 | hashlib import pbkdf2_hmac >>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters) >>> dk.hex() '15530bba69924174860db778f2c6f8104d3aaf9d26241840c8c4a641c8d000a9'
Function only available when Python is compiled with OpenSSL. | trusted_official_docs | CPython Docs | hashlib import pbkdf2_hmac >>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters) >>> dk.hex() '15530bba69924174860db778f2c6f8104d3aaf9d26241840c8c4a641c8d000a9'
Function only available when Python is compiled with OpenSSL. | hashlib import pbkdf2_hmac >>> our_app_iters = 500_000 # Application specific, read above. >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters) >>> dk.hex() '15530bba69924174860db778f2c6f8104d3aaf9d26241840c8c4a641c8d000a9'
Function only available when Python is compiled with OpenSSL. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb94c25d-7d02-473b-a9a5-6e3595aadb92 | CPython Docs | file://datasets/cpython/Doc/library/hashlib.rst | unknown | 582e7c32-91b0-4788-bf1d-37e3e8857105 | 49,884 | supabase-export-v2 | bf07ee900150c683 | As a shortcut, you can pass the first chunk of data to update directly to the constructor as the positional argument:
>>> from hashlib import blake2b
>>> blake2b(b'Hello world').hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac2918... | trusted_official_docs | CPython Docs | As a shortcut, you can pass the first chunk of data to update directly to the constructor as the positional argument:
>>> from hashlib import blake2b
>>> blake2b(b'Hello world').hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac2918... | As a shortcut, you can pass the first chunk of data to update directly to the constructor as the positional argument:
>>> from hashlib import blake2b
>>> blake2b(b'Hello world').hexdigest()
'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac2918... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
00f66e24-c8df-4ea4-a578-8192533002f8 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,961 | supabase-export-v2 | 912d1215689ff67e | .. function:: setraw(fd, when=termios.TCSAFLUSH)
Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to raw mode; this value is retur... | trusted_official_docs | CPython Docs | .. function:: setraw(fd, when=termios.TCSAFLUSH)
Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to raw mode; this value is retur... | .. function:: setraw(fd, when=termios.TCSAFLUSH)
Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to raw mode; this value is retur... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.