def generate_recovery_code(self, user):
        # Code is {hex-days}.{hex-userid}.{signature}
        days = int_to_hex(
            (datetime.date.today() - self.recovery_origin_date).days
        )
        token = '%s.%s' % (days, int_to_hex(user.id))
        return signed.sign(token, key = (
            self.recovery_link_secret or settings.SECRET_KEY
        ) + self.recovery_link_salt)
dataset/ETHPy150Open amarandon/smeuhsocial/apps/django_openid/auth.py/AuthConsumer.generate_recovery_code/original