Skip to content

Commit 7009389

Browse files
committed
add function documentation
1 parent abe7698 commit 7009389

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

convoy/utils/helpers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ def responseHelper(e):
1616
else:
1717
raise Exception(e)
1818

19-
def verifySignature(algorithm, hash, payload, secret):
19+
def verifySignature(algorithm, hmac, payload, secret):
20+
'''
21+
algorithm: hash algorithm e.g SHA256
22+
hmac: the signed payload
23+
payload: the unsigned payload
24+
secret: secret that was used for hashing
25+
'''
2026
dec = hashString(algorithm, payload, secret)
2127
return dec == hash
2228

23-
2429
def hashString(algorithm, msg, secret):
2530
alg = getHashFunction(str.lower(algorithm))
2631
dig = hmac.new(bytes(secret, 'utf-8'), msg=bytes(msg, 'utf-8'), digestmod=alg).digest()

0 commit comments

Comments
 (0)