<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_key(self, email):
 """ Generate a new email confirmation key and return it. """

        salt = sha1(str(random())).hexdigest()[:5]
        return sha1(salt + email).hexdigest()