def encrypt(self, value):
        """Encrypt session data."""
        timestamp = str(int(time.time()))
        value = base64.b64encode(value.encode(self.encoding))
        signature = create_signature(self.secret, value + timestamp.encode(),
                                     encoding=self.encoding)
        return "|".join([value.decode(self.encoding), timestamp, signature])
def encrypt ( self , value ) : timestamp = str ( int ( time . time ( ) ) ) value = base64 . b64encode ( value . encode ( self . encoding ) ) signature = create_signature ( self . secret , value + timestamp . encode ( ) , encoding = self . encoding ) return "|" . join ( [ value . decode ( self . encoding ) , timestamp , signature ] )
Encrypt session data.