<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encrypt(self, message):
 """ Encrypt the given message """


        if not isinstance(message, (bytes, str)):
            raise TypeError
        
        return hashlib.sha1(message.encode('utf-8')).hexdigest()