Skip to content

Instantly share code, notes, and snippets.

@arseniyturin
Last active December 18, 2021 01:24
Show Gist options
  • Save arseniyturin/29c6a6a570414680e438ee603c616c2a to your computer and use it in GitHub Desktop.
Save arseniyturin/29c6a6a570414680e438ee603c616c2a to your computer and use it in GitHub Desktop.
from hashlib import sha1
from base64 import b64encode
def generate_accept_key(key):
GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
sha1_hash = sha1((key + GUID).encode()).digest()
return b64encode(sha1_hash).decode()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment