Package web2py :: Package gluon :: Module validators :: Class CRYPT

[hide private]
[frames] | no frames]

# Class CRYPT

source code

    object --+
             |
            CRYPT

example:

       INPUT(_type='text', _name='name', requires=CRYPT())

encodes the value on validation with a digest.

If no arguments are provided CRYPT uses the MD5 algorithm. If the key argument is provided the HMAC+MD5 algorithm is used. If the digest_alg is specified this is used to replace the MD5 with, for example, SHA512. The digest_alg can be the name of a hashlib algorithm as a string or the algorithm itself.

min_length is the minimal password length (default 4) - IS_STRONG for serious security error_message is the message if password is too short

Notice that an empty password is accepted but invalid. It will not allow login back. Stores junk as hashed password.

Instance Methods | [hide private]

__init__(self, key=global_settings.applications_parent, digest_alg=`'``md5``'`, min_length=0, error_message=`'``too short``'`) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code

__call__(self, value) | source code

Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, key=global_settings.applications_parent, digest_alg=`'``md5``'`, min_length=0, error_message=`'``too short``'`)
(Constructor)

source code

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
  (inherited documentation)