Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created May 3, 2023 01:28
Show Gist options
  • Select an option

  • Save KyMidd/d31eb17f3cb3201fbcabbe358b1470d4 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/d31eb17f3cb3201fbcabbe358b1470d4 to your computer and use it in GitHub Desktop.
# Calculate the signature
def calculate_signature(github_signature, githhub_payload):
signature_bytes = bytes(github_signature, 'utf-8')
digest = hmac.new(key=signature_bytes, msg=githhub_payload, digestmod=hashlib.sha1)
signature = digest.hexdigest()
return signature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment