Module Expr Str ImportFrom alias ImportFrom alias Assign NameStore TupleLoad Str Str Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Str Str Str ImportFrom alias TryExcept body Import alias handlers ExceptHandler type NameLoad name NameStore body Expr Call NameLoad Str Raise NameLoad ImportFrom alias Assign NameStore CompareGtE SubscriptLoad NameLoad Index Num Num FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call AttributeLoad Call NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call NameLoad attr NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults NameLoad body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str If BoolOpAnd UnaryOpNot NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str If BoolOpAnd UnaryOpNot NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd UnaryOpNot NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A 
    flaskext.bcrypt
    ---------------
    
    A Flask extension providing bcrypt hasing and comparison facilities.
    
    :copyright: (c) 2011 by Max Countryman.
    :license: BSD, see LICENSE for more details.
 __future__ absolute_import __future__ print_function N/A __version_info__ N/A 0 7 1 N/A __version__ N/A N/A . join __version_info__ N/A __author__ Max Countryman N/A __license__ BSD N/A __copyright__ (c) 2011 by Max Countryman N/A __all__ N/A Bcrypt check_password_hash generate_password_hash werkzeug.security safe_str_cmp N/A N/A N/A bcrypt N/A N/A N/A ImportError N/A e N/A N/A N/A print bcrypt is required to use Flask-Bcrypt N/A e sys version_info N/A PY3 N/A N/A version_info N/A 0 3 generate_password_hash N/A N/A password rounds N/A None N/A N/A This helper function wraps the eponymous method of :class:`Bcrypt`. It 
    is intended to be used as a helper function at the expense of the 
    configuration variable provided when passing back the app object. In other 
    words this shortcut does not make use of the app object at all.

    To this this function, simple import it from the module and use it in a 
    similar fashion as the method would be used. Here is a quick example::

        from flask.ext.bcrypt import generate_password_hash
        pw_hash = generate_password_hash('hunter2', 10)

    :param password: The password to be hashed.
    :param rounds: The optional number of rounds.
     N/A N/A N/A N/A Bcrypt generate_password_hash password rounds N/A check_password_hash N/A N/A pw_hash password N/A N/A N/A This helper function wraps the eponymous method of :class:`Bcrypt.` It 
    is intended to be used as a helper function at the expense of the 
    configuration variable provided when passing back the app object. In other 
    words this shortcut does not make use of the app object at all.
    
    To this this function, simple import it from the module and use it in a 
    similar fashion as the method would be used. Here is a quick example::
        
        from flask.ext.bcrypt import check_password_hash
        check_password_hash(pw_hash, 'hunter2') # returns True
    
    :param pw_hash: The hash to be compared against.
    :param password: The password to compare.
     N/A N/A N/A N/A Bcrypt check_password_hash pw_hash password N/A Bcrypt N/A object N/A N/A Bcrypt class container for password hashing and checking logic using 
    bcrypt, of course. This class may be used to intialize your Flask app 
    object. The purpose is to provide a simple interface for overriding 
    Werkzeug's built-in password hashing utilities.

    Although such methods are not actually overriden, the API is intentionally 
    made similar so that existing applications which make use of the previous 
    hashing functions might be easily adapted to the stronger facility of 
    bcrypt.

    To get started you will wrap your application's app object something like 
    this::

        app = Flask(__name__)
        bcrypt = Bcrypt(app)

    Now the two primary utility methods are exposed via this object, `bcrypt`.
    So in the context of the application, important data, such as passwords, 
    could be hashed using this syntax::

        password = 'hunter2'
        pw_hash = bcrypt.generate_password_hash(password)

    Once hashed, the value is irreversible. However in the case of validating 
    logins a simple hashing of candidate password and subsequent comparison. 
    Importantly a comparison should be done in constant time. This helps 
    prevent timing attacks. A simple utility method is provided for this::

        candidate = 'secret'
        bcrypt.check_password_hash(pw_hash, candidate)

    If both the candidate and the existing password hash are a match 
    `check_password_hash` returns True. Otherwise, it returns False.

    .. admonition:: Namespacing Issues 

        It's worth noting that if you use the format, `bcrypt = Bcrypt(app)` 
        you are effectively overriding the bcrypt module. Though it's unlikely 
        you would need to access the module outside of the scope of the 
        extension be aware that it's overriden.

        Alternatively consider using a different name, such as `flask_bcrypt 
        = Bcrypt(app)` to prevent naming collisions.

    Additionally a configuration value for `BCRYPT_LOG_ROUNDS` may be set in 
    the configuration of the Flask app. If none is provided this will 
    internally be assigned to 12. (This value is used in determining the 
    complexity of the encryption, see bcrypt for more details.)
    
    :param app: The Flask application object. Defaults to None.
     N/A _log_rounds 12 __init__ N/A N/A self app N/A None N/A N/A N/A app None N/A N/A N/A N/A self init_app app N/A init_app N/A N/A self app N/A N/A N/A Initalizes the application with the extension.

        :param app: The Flask application object.
         N/A N/A self _log_rounds N/A N/A N/A app config get BCRYPT_LOG_ROUNDS 12 N/A generate_password_hash N/A N/A self password rounds N/A None N/A N/A Generates a password hash using bcrypt. Specifying `rounds` 
        sets the log_rounds parameter of `bcrypt.gensalt()` which determines 
        the complexity of the salt. 12 is the default value.

        Example usage of :class:`generate_password_hash` might look something 
        like this::

            pw_hash = bcrypt.generate_password_hash('secret', 10)

        :param password: The password to be hashed.
        :param rounds: The optional number of rounds.
         N/A N/A password N/A N/A N/A ValueError Password must be non-empty. N/A N/A rounds None N/A N/A rounds N/A self _log_rounds N/A N/A PY3 N/A isinstance password str N/A N/A password N/A bytes password utf-8 N/A N/A N/A PY3 N/A isinstance password unicode N/A N/A password N/A N/A password encode utf-8 N/A N/A N/A bcrypt hashpw password N/A N/A bcrypt gensalt rounds N/A check_password_hash N/A N/A self pw_hash password N/A N/A N/A Tests a password hash against a candidate password. The candidate 
        password is first hashed and then subsequently compared in constant 
        time to the existing hash. This will either return `True` or `False`.

        Example usage of :class:`check_password_hash` would look something 
        like this::

            pw_hash = bcrypt.generate_password_hash('secret', 10)
            bcrypt.check_password_hash(pw_hash, 'secret') # returns True

        :param pw_hash: The hash to be compared against.
        :param password: The password to compare.
         N/A N/A PY3 N/A isinstance pw_hash str N/A N/A pw_hash N/A bytes pw_hash utf-8 N/A N/A PY3 N/A isinstance password str N/A N/A password N/A bytes password utf-8 N/A N/A N/A PY3 N/A isinstance pw_hash unicode N/A N/A pw_hash N/A N/A pw_hash encode utf-8 N/A N/A N/A PY3 N/A isinstance password unicode N/A N/A password N/A N/A password encode utf-8 N/A N/A safe_str_cmp N/A N/A bcrypt hashpw password pw_hash pw_hash N/A N/A