<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(self, auth_rest):
 """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. """

        try:
            auth_salt, auth_hash = auth_rest.split('$')
        except ValueError:
            raise ValueError("Missing '$' in %s" % auth_rest)

        if len(auth_salt) == 0:
            raise ValueError("Salt must have non-zero length!")
        if len(auth_hash) != 40:
            raise ValueError("Hash must have 40 chars!")
        if not all(c in string.hexdigits for c in auth_hash):
            raise ValueError("Hash must be hexadecimal!")

        return dict(salt=auth_salt, hash=auth_hash)