-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhashes.py
44 lines (39 loc) · 1.29 KB
/
hashes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import hashlib
def hash_rewards(rewards_data: str) -> str:
"""
Used in:
- getGJRewards
"""
return hashlib.sha1(bytes(rewards_data + 'pC26fpYaQCtg', 'utf-8')).hexdigest()
def hash_levels(levels) -> str:
"""
Used in:
- getGJLevels21
"""
# '{first digit of level id}{last digit of level id}{stars}{starCoins?? 0 works fine So}'
data = ''.join(f"{str(lvl['id'])[0]}{str(lvl['id'])[-1]}{lvl['stars']}0" for lvl in levels)
return hashlib.sha1(bytes(data + 'xI25fpAapCQg', 'utf-8')).hexdigest()
def hash_mappack(mappacks) -> str:
"""
Used in:
- getGJMapPacks21
"""
# '{first digit of mappack id}{last digit of mappack id}{coins}'
data = ''.join(f"{str(mp['id'])[0]}{str(mp['id'])[-1]}{mp['stars']}{mp['coins']}" for mp in mappacks)
return hashlib.sha1(bytes(data + 'xI25fpAapCQg', 'utf-8')).hexdigest()
def hash_level(level: str) -> str:
"""
Used in:
- downloadGJLevel22.php
"""
data = ''
l = len(level) // 40
for i in range(40):
data += level[i * l]
return hashlib.sha1(bytes(data + 'xI25fpAapCQg', 'utf-8')).hexdigest()
def hash_solo2(data: str) -> str:
"""
Used in:
- downloadGJLevel22.php
"""
return hashlib.sha1(bytes(data + 'xI25fpAapCQg', 'utf-8')).hexdigest()