Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_signature():
assert muffin.utils.create_signature('secret', 'message')
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])