def validate(self, auth_rest):
try:<EOL><INDENT>auth_salt, auth_hash = auth_rest.split('<STR_LIT:$>')<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>" % auth_rest)<EOL><DEDENT>if len(auth_salt) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if len(auth_hash) != <NUM_LIT>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not all(c in string.hexdigits for c in auth_hash):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return dict(salt=auth_salt, hash=auth_hash)<EOL>
Validate user credentials whether format is right for Sha1

        :param auth_rest: User credentials' part without auth_type
        :return: Dict with a hash and a salt part of user credentials
        :raises ValueError: If credentials' part doesn't contain delimiter
                            between a salt and a hash.