Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Created August 23, 2022 16:21
Show Gist options
  • Save vikramacharya/59267b136c25b57e2186ff3a22f602ce to your computer and use it in GitHub Desktop.
Save vikramacharya/59267b136c25b57e2186ff3a22f602ce to your computer and use it in GitHub Desktop.
import datetime
def create_signing_string(digest_base64, created=None, expires=None):
if created is None:
created = int(datetime.datetime.now().timestamp())
if expires is None:
expires = int((datetime.datetime.now() + datetime.timedelta(hours=1)).timestamp())
signing_string = f"""(created): {created}
(expires): {expires}
digest: BLAKE-512={digest_base64}"""
return signing_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment