diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2016-11-20 14:11:35 -0500 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2016-11-20 14:11:35 -0500 |
| commit | a54c5ba533592f7113fd3a4a86bf8a036baa7860 (patch) | |
| tree | 1c36f1329efb86a637ff365c3e7a6a8819ed3cc5 /passlib | |
| parent | b214f86b7523f3adaf8bdcf78ffbddf351c0fb3d (diff) | |
| download | passlib-a54c5ba533592f7113fd3a4a86bf8a036baa7860.tar.gz | |
docs: LARGE update to documentation, tutorials added, pages relocated
* moved a bunch of pages into 'docs/narr' narrative subsection.
added placeholder pages in old locations, to minimize inbound link breakage.
* split history into separate pages, was getting way too long.
removed toplevel CHANGES file, not feasible under new structure.
* passlib.ifc split into reference & tutorial portions,
tutorial allowed subsuming a bunch of other hash-usage examples.
* added standard fragments for warning about insecure hashes,
added them to top of a LOT of hash doc pages.
* updated references, various layout tweaks
Diffstat (limited to 'passlib')
| -rw-r--r-- | passlib/crypto/digest.py | 16 | ||||
| -rw-r--r-- | passlib/handlers/bcrypt.py | 2 | ||||
| -rw-r--r-- | passlib/pwd.py | 8 | ||||
| -rw-r--r-- | passlib/registry.py | 4 |
4 files changed, 17 insertions, 13 deletions
diff --git a/passlib/crypto/digest.py b/passlib/crypto/digest.py index 78c2ad4..2d8006a 100644 --- a/passlib/crypto/digest.py +++ b/passlib/crypto/digest.py @@ -207,18 +207,22 @@ def lookup_hash(digest, return_unknown=False): Can be used to look up a hash constructor by name, normalize hash name representation, etc. :arg digest: - A string containing a :mod:`!hashlib` digest name (e.g. ``"sha256"``), - an IANA-assigned hash name, or even a digest constructor (e.g. :func:`hashlib.sha256`). + This can be any of: + + * A string containing a :mod:`!hashlib` digest name (e.g. ``"sha256"``), + * A string containing an IANA-assigned hash name, + * A digest constructor function (e.g. ``hashlib.sha256``). + Case is ignored, underscores are converted to hyphens, and various other cleanups are made. :param return_unknown: - By default, this function will throw a :exc:`~passlib.exc.KnownHashError` if no hash constructor + By default, this function will throw an :exc:`~passlib.exc.UnknownHashError` if no hash constructor can be found. However, if this flag is False, it will instead return a dummy record without a constructor function. This is mainly used by :func:`norm_hash_name`. :returns HashInfo: - :class:`!HashInfo` instance containing information about specified digest. + :class:`HashInfo` instance containing information about specified digest. Multiple calls resolving to the same hash should always return the same :class:`!HashInfo` instance. @@ -323,8 +327,8 @@ def norm_hash_name(name, format="hashlib"): with Python's :mod:`!hashlib`. * ``"iana"`` - normalizes name to IANA-assigned hash function name. - for hashes which IANA hasn't assigned a name for, issues a warning, - and then uses a heuristic to give a "best guess". + For hashes which IANA hasn't assigned a name for, this issues a warning, + and then uses a heuristic to return a "best guess" name. :returns: Hash name, returned as native :class:`!str`. diff --git a/passlib/handlers/bcrypt.py b/passlib/handlers/bcrypt.py index 91d5840..8f8cd62 100644 --- a/passlib/handlers/bcrypt.py +++ b/passlib/handlers/bcrypt.py @@ -695,7 +695,7 @@ class _PyBcryptBackend(_BcryptCommon): #----------------------------------------------------------------------- class _OsCryptBackend(_BcryptCommon): """ - backend which uses os.crypt() + backend which uses :func:`crypt.crypt` """ @classmethod diff --git a/passlib/pwd.py b/passlib/pwd.py index 7e7be91..580acd3 100644 --- a/passlib/pwd.py +++ b/passlib/pwd.py @@ -434,7 +434,7 @@ def genword(entropy=None, length=None, returns=None, **kwds): based on the requested entropy amount, and the size of the character set. If both ``entropy`` and ``length`` are specified, - the larger effective length will be used. + the stronger value will be used. This can also be one of a handful of aliases to predefined entropy amounts: ``"weak"`` (24), ``"fair"`` (36), @@ -453,9 +453,9 @@ def genword(entropy=None, length=None, returns=None, **kwds): :param charset: The character set to draw from, if not specified explicitly by **chars**. - Defaults to ``"ascii_62"``, but can be any of: + Can be any of: - * ``"ascii_62"`` -- all digits and ascii upper & lowercase letters. + * ``"ascii_62"`` (the default) -- all digits and ascii upper & lowercase letters. Provides ~5.95 entropy per character. * ``"ascii_50"`` -- subset which excludes visually similar characters @@ -697,7 +697,7 @@ def genphrase(entropy=None, length=None, returns=None, **kwds): based on the requested entropy amount, and the size of the character set. If both ``entropy`` and ``length`` are specified, - the larger effective length will be used. + the stronger value will be used. This can also be one of a handful of aliases to predefined entropy amounts: ``"weak"`` (24), ``"fair"`` (36), diff --git a/passlib/registry.py b/passlib/registry.py index 44076c7..fe6cc6a 100644 --- a/passlib/registry.py +++ b/passlib/registry.py @@ -509,7 +509,7 @@ def has_backend(hasher, backend=ANY, safe=False): @memoize_single_value def get_supported_os_crypt_schemes(): """ - return tuple of schemes which :func:`os.crypt` natively supports. + return tuple of schemes which :func:`crypt.crypt` natively supports. """ if not os_crypt_present: return () @@ -525,7 +525,7 @@ def get_supported_os_crypt_schemes(): # TODO: needs UTs def has_os_crypt_support(hasher): """ - check if hash is supported by native :func:`os.crypt` function. + check if hash is supported by native :func:`crypt.crypt` function. if :func:`crypt.crypt` is not present, will always return False. :param hasher: |
