Created
August 23, 2022 16:21
-
-
Save vikramacharya/59267b136c25b57e2186ff3a22f602ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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