ó
    ´æ¹ip  ã                   ó:  • S r SSKJrJrJrJr  SSKrSSKJr   SSK	J
r
  SSKJrJr  SSKr\R"                  " \5      rSSKrSSKrSSKJr  SSKJrJrJrJr  SS	KJrJrJr  SS
K J!r!  / SQr"\#" SSSSSS9r$S r%S r&S(S jr'\(\)4r*\+\,4r-\+" 5       r.S)S jr/ " S S\05      r1\#" SSSSS9r2 " S S\15      r3S*S jr4S  r5 " S! S"\
5      r6\6" 5       r7S#Rq                  5        H  r9\7Ru                  \9S$\9-  5        M      " S% S&\15      r;S*S' jr<g! \ a	    SSKJ
r
   Nùf = f)+z*passlib.pwd -- password generation helpersé    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literalsN)Údefaultdict)ÚMutableMapping)ÚceilÚlog)Úexc)ÚPY2ÚirangeÚ
itervaluesÚ	int_types)ÚrngÚ
getrandstrÚ
to_unicode)Úmemoized_property)ÚgenwordÚdefault_charsetsÚ	genphraseÚdefault_wordsetsé   é   é$   é0   é<   )ÚunsafeÚweakÚfairÚstrongÚsecurec                 óX   • [        U 5      R                  nX"R                  U5      S-   S $ )z2return remaining classes in object's MRO after clsé   N)ÚtypeÚ__mro__Úindex)ÚobjÚclsÚmros      Ú\/home/gothic/Documentos/geniubs/sat/app/api/venv/lib/python3.13/site-packages/passlib/pwd.pyÚ_superclassesr+   8   s*   € ä
ˆs‹)×
Ñ
€CØ�y‰y˜‹~˜aÑÐ Ð!Ð!ó    c                 ó.  •  [        U 5      n[        [        5      nU  H  nX#==   S-  ss'   M     Uc  UR	                  5       n[        U5      nO[        U5      nU(       d  g[        US5      [        S U 5       5      U-  -
  $ ! [         a    Sn N†f = f)aË  
returns 'rate of self-information' --
i.e. average (per-symbol) entropy of the sequence **source**,
where probability of a given symbol occurring is calculated based on
the number of occurrences within the sequence itself.

if all elements of the source are unique, this should equal ``log(len(source), 2)``.

:arg source:
    iterable containing 0+ symbols
    (e.g. list of strings or ints, string of characters, etc).

:returns:
    float bits of entropy
Nr#   r   é   c              3   ó>   #   • U  H  o[        US 5      -  v •  M     g7f)r.   N)Úlogf)Ú.0Úvalues     r*   Ú	<genexpr>Ú"_self_info_rate.<locals>.<genexpr>_   s   é € ÐJÂ6¸%¤t¨E°1£~Ö5Â6ùs   ‚)ÚlenÚ	TypeErrorr   ÚintÚvaluesÚsumr   r0   )ÚsourceÚsizeÚcountsÚcharr8   s        r*   Ú_self_info_rater>   >   s”   € ð Ü�6‹{ˆô œÓ€FÛˆØ‹˜Ñ�ñ à�|Ø—‘“ˆÜ�6‹{‰ä˜FÓ#ˆÞØô ��a‹=œ3ÑJÁ6ÓJÓJÈTÑQÑQÐQøô ó àŠðús   ‚B ÂBÂBc                 ó:  • U(       a%  [         R                  " U5      " [        U 5      5      $ [        R                  R                  U 5      (       a  [        U S5      $ U R                  S5      u  p#nU(       d  [        SU < 35      e[        R                  " X$5      $ )zð
:param asset_path:
    string containing absolute path to file,
    or package-relative path using format
    ``"python.module:relative/file/path"``.

:returns:
    filehandle opened in 'rb' mode
    (unless encoding explicitly specified)
ÚrbÚ:zIasset path must be absolute file path or use 'pkg.name:sub/path' format: )ÚcodecsÚ	getreaderÚ_open_asset_pathÚosÚpathÚisabsÚopenÚ	partitionÚ
ValueErrorÚpkg_resourcesÚresource_stream)rF   ÚencodingÚpackageÚsepÚsubpaths        r*   rD   rD   j   s‚   € ö Ü×Ò Ô)Ô*:¸4Ó*@ÓAÐAÜ	‡w�w‡}�}�T×ÑÜ�D˜$ÓÐØ ŸN™N¨3Ó/Ñ€G�'ÞÝÚDHðKó Lð 	Lä×(Ò(¨Ó:Ð:r,   c                 óR  • [         nSn X;   a  g [        U [        5      (       d!  [	        [        U 5      5      [	        U 5      :X  a  U(       a   UR                  U 5        gg[        5       n[        5       nU  H  nXd;   a  UOUR                  U5        M     [        U5      nSn[	        U5      U:”  a  SnSR                  S USU  5       5      n[	        U5      U:”  a  US[	        U5      U-
  -  -  n[        S	U< S
U< 35      e! [         a    Sn GNf = f! [         a     gf = f)zŸ
helper for generators --
Throws ValueError if source elements aren't unique.
Error message will display (abbreviated) repr of the duplicates in a string/list
TFé   é   ú, c              3   óJ   #   • U  H  n[        [        U5      5      v •  M     g 7f©N)ÚreprÚstr©r1   Úwords     r*   r3   Ú!_ensure_unique.<locals>.<genexpr>«   s   é € ÐB²\¨Tœœc $›iŸ˜²\ùs   ‚!#Nz, ... plus %d othersÚ`z%` cannot contain duplicate elements: )
Ú_ensure_unique_cacher6   Ú
isinstanceÚ
_set_typesr5   ÚsetÚaddÚsortedÚjoinrJ   )	r:   ÚparamÚcacheÚhashableÚseenÚdupsÚelemÚtruncÚdup_reprs	            r*   Ú_ensure_uniquerl   ˆ   s/  € ô !€EØ€HðØ‹?Øð ô �&œ*×%Ñ%¬¬S°«[Ó)9¼SÀ»[Ó)HÞðØ—	‘	˜&Ô!ñ
 ô ‹5€DÜ‹5€DÛˆØ“‰ 4×,Ñ,¨TÖ2ñ ä�$‹<€DØ€EÜ
ˆ4ƒy�5ÓØˆØ�y‰yÑB°T¸&¸5±\ÓBÓB€HÜ
ˆ4ƒy�5ÓØÐ*¬c°$«i¸%Ñ.?Ñ@Ñ@ˆõ ÛšXð'ó (ð (øô9 ó Ø‹ðûô ó ð Øð	ús#   ŠD ÁD ÄDÄDÄ
D&Ä%D&c                   ó–   ^ • \ rS rSrSrSrSr\rSrSU 4S jjr	\
S 5       r\
S 5       rS rSS	 jrS
 r\(       a	  S rSrU =r$ SrU =r$ )ÚSequenceGeneratoré¶   aÙ  
Base class used by word & phrase generators.

These objects take a series of options, corresponding
to those of the :func:`generate` function.
They act as callables which can be used to generate a password
or a list of 1+ passwords. They also expose some read-only
informational attributes.

Parameters
----------
:param entropy:
    Optionally specify the amount of entropy the resulting passwords
    should contain (as measured with respect to the generator itself).
    This will be used to auto-calculate the required password size.

:param length:
    Optionally specify the length of password to generate,
    measured as count of whatever symbols the subclass uses (characters or words).
    Note if ``entropy`` requires a larger minimum length,
    that will be used instead.

:param rng:
    Optionally provide a custom RNG source to use.
    Should be an instance of :class:`random.Random`,
    defaults to :class:`random.SystemRandom`.

Attributes
----------
.. autoattribute:: length
.. autoattribute:: symbol_count
.. autoattribute:: entropy_per_symbol
.. autoattribute:: entropy

Subclassing
-----------
Subclasses must implement the ``.__next__()`` method,
and set ``.symbol_count`` before calling base ``__init__`` method.
Nr    c                 ó  >• U R                   c   S5       eUc  Uc_  Uc  U R                  n[        R                  X5      nUS::  a  [	        S5      e[        [        XR                  -  5      5      nUb  X%:  a  UnXl        US:  a  [	        S5      eX l        Ub  X0l	        U(       aD  [        U [        5      [        4:X  a+  [        SSR                  UR                  5       5      -  5      e[         [        U ]F  " S0 UD6  g )	Nzsubclass must set .symbol_countr   z!`entropy` must be positive numberr#   z!`length` must be positive integerzUnexpected keyword(s): %srT   © )Úsymbol_countÚrequested_entropyÚentropy_aliasesÚgetrJ   r7   r	   Úentropy_per_symbolÚlengthr   r+   rn   Úobjectr6   rc   ÚkeysÚsuperÚ__init__)ÚselfÚentropyrw   r   ÚkwdsÚ
min_lengthÚ	__class__s         €r*   r{   ÚSequenceGenerator.__init__ñ   sö   ø€ ð × Ñ Ñ,ÐOÐ.OÓOÐ,ð Ñ &¡.Ø‰Ø×0Ñ0�Ü%×)Ñ)¨'Ó;ˆGØ˜!‹|Ü Ð!DÓEÐEÜœT '×,CÑ,CÑ"CÓDÓEˆJØ‰~ Ó!4Ø#�à!(Ôà�A‹:ÜÐ@ÓAÐAØŒð ‰?ØŒHö ”M $Ô(9Ó:¼v¸iÓGÜÐ7¸$¿)¹)ÀDÇIÁIÃKÓ:PÑPÓQÐQÜÔ Ò/Ñ7°$Ó7r,   c                 ó.   • [        U R                  S5      $ )zJ
Average entropy per symbol (assuming all symbols have equal probability)
r.   )r0   rr   ©r|   s    r*   rv   Ú$SequenceGenerator.entropy_per_symbol  s   € ô
 �D×%Ñ% qÓ)Ð)r,   c                 ó4   • U R                   U R                  -  $ )a  
Effective entropy of generated passwords.

This value will always be a multiple of :attr:`entropy_per_symbol`.
If entropy is specified in constructor, :attr:`length` will be chosen so
so that this value is the smallest multiple >= :attr:`requested_entropy`.
)rw   rv   rƒ   s    r*   r}   ÚSequenceGenerator.entropy  s   € ð �{‰{˜T×4Ñ4Ñ4Ð4r,   c                 ó   • [        S5      e)z;main generation function, should create one password/phrasezimplement in subclass)ÚNotImplementedErrorrƒ   s    r*   Ú__next__ÚSequenceGenerator.__next__)  s   € ä!Ð"9Ó:Ð:r,   c                 óâ   • Uc  [        U 5      $ [        U[        5      (       a%  [        U5       Vs/ s H  n[        U 5      PM     sn$ U[        L a  U $ [
        R                  " USS5      es  snf )z>
frontend used by genword() / genphrase() to create passwords
z<None>, int, or <iter>Úreturns)Únextr^   r   r   Úiterr   ÚExpectedTypeError)r|   rŒ   Ú_s      r*   Ú__call__ÚSequenceGenerator.__call__-  sd   € ð ‰?Ü˜“:ÐÜ˜¤×+Ñ+Ü(.¨w¬Ó8ª 1”D˜–J©Ñ8Ð8ØœŠ_ØˆKä×'Ò'¨Ð1IÈ9ÓUÐUùò	 9s   ±A,c                 ó   • U $ rV   rq   rƒ   s    r*   Ú__iter__ÚSequenceGenerator.__iter__:  s   € Øˆr,   c                 ó"   • U R                  5       $ rV   )r‰   rƒ   s    r*   r�   ÚSequenceGenerator.next>  s   € Ø—=‘=“?Ð"r,   )rw   rs   r   ©NNNrV   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rw   rs   r   rr   r{   r   rv   r}   r‰   r‘   r”   r   r�   Ú__static_attributes__Ú__classcell__©r€   s   @r*   rn   rn   ¶   sx   ø† ñ&ðX €Fð !Ðð €Cð €L÷
8ðF ñ*ó ð*ð ñ5ó ð5ò;ôVòö ÷	#ð 	#õ r,   rn   zH0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*?/Ú>0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZÚ2234679abcdefghjkmnpqrstuvwxyzACDEFGHJKMNPQRTUVWXYZÚ0123456789abcdef)Úascii_72Úascii_62Úascii_50Úhexc                   óN   ^ • \ rS rSrSrSrSrS	U 4S jjr\S 5       r	S r
SrU =r$ )
ÚWordGeneratori\  a®  
Class which generates passwords by randomly choosing from a string of unique characters.

Parameters
----------
:param chars:
    custom character string to draw from.

:param charset:
    predefined charset to draw from.

:param \*\*kwds:
    all other keywords passed to the :class:`SequenceGenerator` parent class.

Attributes
----------
.. autoattribute:: chars
.. autoattribute:: charset
.. autoattribute:: default_charsets
r¥   Nc                 óì   >• U(       a  U(       a  [        S5      eO%U(       d  U R                  nU(       d   e[        U   nX l        [        USS9n[	        USS9  Xl        [        [        U ]"  " S0 UD6  g )Nz,`chars` and `charset` are mutually exclusiveÚchars©rd   rq   )	r6   Úcharsetr   r   rl   r«   rz   r©   r{   )r|   r«   r­   r~   r€   s       €r*   r{   ÚWordGenerator.__init__~  so   ø€ ö ÞÜÐ NÓOÐOð ö ØŸ,™,�Þ��wÜ$ WÑ-ˆEØŒÜ˜5¨Ñ0ˆÜ�u GÒ,ØŒ
ô 	Œm˜TÒ+Ñ3¨dÓ3r,   c                 ó,   • [        U R                  5      $ rV   )r5   r«   rƒ   s    r*   rr   ÚWordGenerator.symbol_count–  ó   € ä�4—:‘:‹Ðr,   c                 óX   • [        U R                  U R                  U R                  5      $ rV   )r   r   r«   rw   rƒ   s    r*   r‰   ÚWordGenerator.__next__ž  s   € ô ˜$Ÿ(™( D§J¡J°·±Ó<Ð<r,   )r«   r­   )NN)r™   rš   r›   rœ   r�   r­   r«   r{   r   rr   r‰   rž   rŸ   r    s   @r*   r©   r©   \  s9   ø† ñð2 €Gð €E÷
4ð0 ñó ð÷=ð =r,   r©   c                 ó,   • [        SXS.UD6nU" U5      $ )aö	  Generate one or more random passwords.

This function uses :mod:`random.SystemRandom` to generate
one or more passwords using various character sets.
The complexity of the password can be specified
by size, or by the desired amount of entropy.

Usage Example::

    >>> # generate a random alphanumeric string with 48 bits of entropy (the default)
    >>> from passlib import pwd
    >>> pwd.genword()
    'DnBHvDjMK6'

    >>> # generate a random hexadecimal string with 52 bits of entropy
    >>> pwd.genword(entropy=52, charset="hex")
    '310f1a7ac793f'

:param entropy:
    Strength of resulting password, measured in 'guessing entropy' bits.
    An appropriate **length** value will be calculated
    based on the requested entropy amount, and the size of the character set.

    This can be a positive integer, or one of the following preset
    strings: ``"weak"`` (24), ``"fair"`` (36),
    ``"strong"`` (48), and ``"secure"`` (56).

    If neither this or **length** is specified, **entropy** will default
    to ``"strong"`` (48).

:param length:
    Size of resulting password, measured in characters.
    If omitted, the size is auto-calculated based on the **entropy** parameter.

    If both **entropy** and **length** are specified,
    the stronger value will be used.

:param returns:
    Controls what this function returns:

    * If ``None`` (the default), this function will generate a single password.
    * If an integer, this function will return a list containing that many passwords.
    * If the ``iter`` constant, will return an iterator that yields passwords.

:param chars:

    Optionally specify custom string of characters to use when randomly
    generating a password. This option cannot be combined with **charset**.

:param charset:

    The predefined character set to draw from (if not specified by **chars**).
    There are currently four presets available:

    * ``"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
      (``1IiLl0Oo5S8B``). Provides ~5.64 entropy per character.

    * ``"ascii_72"`` -- all digits and ascii upper & lowercase letters,
      as well as some punctuation. Provides ~6.17 entropy per character.

    * ``"hex"`` -- Lower case hexadecimal.  Providers 4 bits of entropy per character.

:returns:
    :class:`!unicode` string containing randomly generated password;
    or list of 1+ passwords if :samp:`returns={int}` is specified.
)rw   r}   rq   )r©   ©r}   rw   rŒ   r~   Úgens        r*   r   r   ¨  s!   € ôL Ð
?˜vÑ
?¸$Ñ
?€CÙˆw‹<Ðr,   c                 óÈ   • [        U S5       nS U 5       n[        S U 5       5      nSSS5        [        R                  S[	        W5      U 5        U$ ! , (       d  f       N0= f)a  
load wordset from compressed datafile within package data.
file should be utf-8 encoded

:param asset_path:
    string containing  absolute path to wordset file,
    or "python.module:relative/file/path".

:returns:
    tuple of words, as loaded from specified words file.
zutf-8c              3   ó@   #   • U  H  oR                  5       v •  M     g 7frV   )ÚstriprY   s     r*   r3   Ú _load_wordset.<locals>.<genexpr>  s   é € Ð+ª �z‰z�|ˆ|ªùs   ‚c              3   ó6   #   • U  H  o(       d  M  Uv •  M     g 7frV   rq   rY   s     r*   r3   rº     s   é € Ð3¢s˜t«d—d‘d¢sùs   ‚
�	Nz!loaded %d-element wordset from %r)rD   Útupler
   Údebugr5   )Ú
asset_pathÚfhr¶   Úwordss       r*   Ú_load_wordsetrÁ   õ  sT   € ô 
˜* gÔ	.°"Ù+©Ó+ˆÜÑ3¡sÓ3Ó3ˆ÷ 
/ô$ ‡I�IÐ1´3°u³:¸zÔJØ€L÷' 
/Õ	.ús   �AÁ
A!c                   ón   ^ • \ rS rSrSrSrSrU 4S jrS rS r	S r
S r\S	 5       rS
 rS rS rSrU =r$ )ÚWordsetDicti  z’
Special mapping used to store dictionary of wordsets.
Different from a regular dict in that some wordsets
may be lazy-loaded from an asset path.
Nc                 óJ   >• 0 U l         0 U l        [        [        U ]  " U0 UD6  g rV   )ÚpathsÚ_loadedrz   rÃ   r{   )r|   Úargsr~   r€   s      €r*   r{   ÚWordsetDict.__init__%  s%   ø€ ØˆŒ
ØˆŒÜŒk˜4Ò)¨4Ð8°4Ó8r,   c                 ó–   •  U R                   U   $ ! [         a     Of = fU R                  U   n[        U5      =o0R                   U'   U$ rV   )rÆ   ÚKeyErrorrÅ   rÁ   )r|   ÚkeyrF   r2   s       r*   Ú__getitem__ÚWordsetDict.__getitem__*  sP   € ð	Ø—<‘< Ñ$Ð$øÜó 	Ùð	úà�z‰z˜#‰ˆÜ$1°$Ó$7Ð7ˆ—‘˜SÑ!Øˆs   ‚ ‘
�c                 ó    • X R                   U'   g)z+
set asset path to lazy-load wordset from.
N)rÅ   )r|   rË   rF   s      r*   Úset_pathÚWordsetDict.set_path3  s   € ð �
‰
�3Šr,   c                 ó    • X R                   U'   g rV   )rÆ   )r|   rË   r2   s      r*   Ú__setitem__ÚWordsetDict.__setitem__9  s   € Ø!�‰�SÒr,   c                 ó|   • X;   a*  U R                   U	 U R                  R                  US 5        g U R                  U	 g rV   )rÆ   rÅ   Úpop©r|   rË   s     r*   Ú__delitem__ÚWordsetDict.__delitem__<  s0   € Ø‹;Ø—‘˜SÐ!Ø�J‰J�N‰N˜3 Õ%à—
‘
˜3‘r,   c                 óf   • [        U R                  5      nUR                  U R                  5        U$ rV   )r`   rÆ   ÚupdaterÅ   )r|   ry   s     r*   Ú_keysetÚWordsetDict._keysetC  s%   € ä�4—<‘<Ó ˆØ�‰�D—J‘JÔØˆr,   c                 ó,   • [        U R                  5      $ rV   )rŽ   rÛ   rƒ   s    r*   r”   ÚWordsetDict.__iter__I  s   € Ü�D—L‘LÓ!Ð!r,   c                 ó,   • [        U R                  5      $ rV   )r5   rÛ   rƒ   s    r*   Ú__len__ÚWordsetDict.__len__L  s   € Ü�4—<‘<Ó Ð r,   c                 óH   • XR                   ;   =(       d    XR                  ;   $ rV   ©rÆ   rÅ   rÖ   s     r*   Ú__contains__ÚWordsetDict.__contains__P  s   € Ø—l‘lÑ"×7 c¯Z©ZÑ&7Ð7r,   rã   )r™   rš   r›   rœ   r�   rÅ   rÆ   r{   rÌ   rÏ   rÒ   r×   ÚpropertyrÛ   r”   rà   rä   rž   rŸ   r    s   @r*   rÃ   rÃ     sW   ø† ñð €Eð €Gõ9ò
òò"ò ð ñó ðò
"ò!÷8ð 8r,   rÃ   z%eff_long eff_short eff_prefixed bip39zpasslib:_data/wordsets/%s.txtc                   óR   ^ • \ rS rSrSrSrSrSrS
U 4S jjr\	S 5       r
S rS	rU =r$ )ÚPhraseGeneratori_  a   class which generates passphrases by randomly choosing
from a list of unique words.

:param wordset:
    wordset to draw from.
:param preset:
    name of preset wordlist to use instead of ``wordset``.
:param spaces:
    whether to insert spaces between words in output (defaults to ``True``).
:param \*\*kwds:
    all other keywords passed to the :class:`SequenceGenerator` parent class.

.. autoattribute:: wordset
Úeff_longNÚ c                 ó>  >• Ub  Ub  [        S5      eO!Uc  U R                  nU(       d   e[        U   nXl        [        U[        5      (       d  [        U5      n[        USS9  X l        Uc  U R                  n[        USS9nX0l        [        [        U ]2  " S0 UD6  g )Nz,`words` and `wordset` are mutually exclusiverÀ   r¬   rO   rq   )r6   Úwordsetr   r^   Ú_sequence_typesr¼   rl   rÀ   rO   r   rz   rè   r{   )r|   rì   rÀ   rO   r~   r€   s        €r*   r{   ÚPhraseGenerator.__init__~  s¤   ø€ ð ÑØÑ"ÜÐ NÓOÐOð #ð ‰ØŸ,™,�Þ��wÜ$ WÑ-ˆEØŒô ˜%¤×1Ñ1Ü˜%“LˆEÜ�u GÒ,ØŒ
ð ‰;Ø—(‘(ˆCÜ˜ EÑ*ˆØŒô 	Œo˜tÒ-Ñ5°Ó5r,   c                 ó,   • [        U R                  5      $ rV   )r5   rÀ   rƒ   s    r*   rr   ÚPhraseGenerator.symbol_count   r±   r,   c                 óx   ^ • U 4S j[        T R                  5       5       nT R                  R                  U5      $ )Nc              3   ón   >#   • U  H*  nTR                   R                  TR                  5      v •  M,     g 7frV   )r   ÚchoicerÀ   )r1   r�   r|   s     €r*   r3   Ú+PhraseGenerator.__next__.<locals>.<genexpr>©  s'   øé € ÐJÒ6I°�—‘—‘ §¡×,Ð,Ò6Iùs   ƒ25)r   rw   rO   rc   )r|   rÀ   s   ` r*   r‰   ÚPhraseGenerator.__next__¨  s)   ø€ ÜJ´f¸T¿[¹[Ô6IÓJˆØ�x‰x�}‰}˜UÓ#Ð#r,   )rO   rÀ   rì   r˜   )r™   rš   r›   rœ   r�   rì   rÀ   rO   r{   r   rr   r‰   rž   rŸ   r    s   @r*   rè   rè   _  sA   ø† ñð& €Gð €Eð €C÷
6ðD ñó ð÷$ð $r,   rè   c                 ó,   • [        SXS.UD6nU" U5      $ )a]  Generate one or more random password / passphrases.

This function uses :mod:`random.SystemRandom` to generate
one or more passwords; it can be configured to generate
alphanumeric passwords, or full english phrases.
The complexity of the password can be specified
by size, or by the desired amount of entropy.

Usage Example::

    >>> # generate random phrase with 48 bits of entropy
    >>> from passlib import pwd
    >>> pwd.genphrase()
    'gangly robbing salt shove'

    >>> # generate a random phrase with 52 bits of entropy
    >>> # using a particular wordset
    >>> pwd.genword(entropy=52, wordset="bip39")
    'wheat dilemma reward rescue diary'

:param entropy:
    Strength of resulting password, measured in 'guessing entropy' bits.
    An appropriate **length** value will be calculated
    based on the requested entropy amount, and the size of the word set.

    This can be a positive integer, or one of the following preset
    strings: ``"weak"`` (24), ``"fair"`` (36),
    ``"strong"`` (48), and ``"secure"`` (56).

    If neither this or **length** is specified, **entropy** will default
    to ``"strong"`` (48).

:param length:
    Length of resulting password, measured in words.
    If omitted, the size is auto-calculated based on the **entropy** parameter.

    If both **entropy** and **length** are specified,
    the stronger value will be used.

:param returns:
    Controls what this function returns:

    * If ``None`` (the default), this function will generate a single password.
    * If an integer, this function will return a list containing that many passwords.
    * If the ``iter`` builtin, will return an iterator that yields passwords.

:param words:

    Optionally specifies a list/set of words to use when randomly generating a passphrase.
    This option cannot be combined with **wordset**.

:param wordset:

    The predefined word set to draw from (if not specified by **words**).
    There are currently four presets available:

    ``"eff_long"`` (the default)

        Wordset containing 7776 english words of ~7 letters.
        Constructed by the EFF, it offers ~12.9 bits of entropy per word.

        This wordset (and the other ``"eff_"`` wordsets)
        were `created by the EFF <https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases>`_
        to aid in generating passwords.  See their announcement page
        for more details about the design & properties of these wordsets.

    ``"eff_short"``

        Wordset containing 1296 english words of ~4.5 letters.
        Constructed by the EFF, it offers ~10.3 bits of entropy per word.

    ``"eff_prefixed"``

        Wordset containing 1296 english words of ~8 letters,
        selected so that they each have a unique 3-character prefix.
        Constructed by the EFF, it offers ~10.3 bits of entropy per word.

    ``"bip39"``

        Wordset of 2048 english words of ~5 letters,
        selected so that they each have a unique 4-character prefix.
        Published as part of Bitcoin's `BIP 39 <https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt>`_,
        this wordset has exactly 11 bits of entropy per word.

        This list offers words that are typically shorter than ``"eff_long"``
        (at the cost of slightly less entropy); and much shorter than
        ``"eff_prefixed"`` (at the cost of a longer unique prefix).

:param sep:
    Optional separator to use when joining words.
    Defaults to ``" "`` (a space), but can be an empty string, a hyphen, etc.

:returns:
    :class:`!unicode` string containing randomly generated passphrase;
    or list of 1+ passphrases if :samp:`returns={int}` is specified.
)r}   rw   rq   )rè   rµ   s        r*   r   r   ±  s!   € ôB Ð
A 'Ñ
A¸DÑ
A€CÙˆw‹<Ðr,   rV   )r:   r˜   )=r�   Ú
__future__r   r   r   r   rB   Úcollectionsr   Úcollections.abcr   ÚImportErrorÚmathr	   r
   r0   ÚloggingÚ	getLoggerr™   rK   rE   Úpasslibr   Úpasslib.utils.compatr   r   r   r   Úpasslib.utilsr   r   r   Úpasslib.utils.decorr   Ú__all__Údictrt   r+   r>   rD   Úlistr¼   rí   r`   Ú	frozensetr_   r]   rl   rx   rn   r   r©   r   rÁ   rÃ   r   ÚsplitÚnamerÏ   rè   r   rq   r,   r*   Ú<module>r     sj  ðÙ 0÷ SÓ Rã Ý #ð+Ý.÷ #Û �g×'Ò'¨Ó1�Û Û 	õ ß CÓ Cß 5Ñ 5Ý 1ò€ñ àð 
ð 
ð ð ñ€ò*"ò!RôX;ð. ˜�-€Ø�9Ð€
ñ “uÐ ô)(ô\I#˜ô I#ñh àWð Nð Bð 	ñÐ ô$E=Ð%ô E=ôXGòZ ôF98�.ô 98ñ| “=Ð ð 4×9Ñ9Ö;€DØ×Ñ˜dÐ$CÀdÑ$JÖKñ <ôK$Ð'ô K$õdbøðM ó +ç*ð+ús   šD ÄDÄD