foodforus: move api_key to end of signature
parent
bc9d6f3453
commit
db3b6ba2d0
|
@ -14,11 +14,12 @@ API_URL = 'http://foodfor.vtluug.org'
|
||||||
|
|
||||||
|
|
||||||
def _sign_vote(api_key, args):
|
def _sign_vote(api_key, args):
|
||||||
data = "ffu0" + api_key
|
data = "ffu1"
|
||||||
for k, v in sorted(args.items()):
|
for k, v in sorted(args.items()):
|
||||||
if k == 'sig':
|
if k == 'sig':
|
||||||
continue
|
continue
|
||||||
data += '{0}{1}'.format(k, v)
|
data += '{0}{1}'.format(k, v)
|
||||||
|
data += api_key
|
||||||
h = hashlib.sha256()
|
h = hashlib.sha256()
|
||||||
h.update(data.encode('utf-8'))
|
h.update(data.encode('utf-8'))
|
||||||
return h.hexdigest()
|
return h.hexdigest()
|
||||||
|
|
Loading…
Reference in New Issue