Skip to content

Commit

Permalink
v1.3.2 update ua
Browse files Browse the repository at this point in the history
  • Loading branch information
lanqian528 committed Jun 20, 2024
1 parent 038783c commit 336875f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chatgpt/ChatService.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class ChatService:
def __init__(self, origin_token=None):
self.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0"
self.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
self.req_token = get_req_token(origin_token)
self.chat_token = "gAAAAAB"
self.s = None
Expand Down
6 changes: 3 additions & 3 deletions chatgpt/proofofWork.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def get_config(user_agent):
random.choice(navigator_key),
random.choice(document_key),
random.choice(window_key),
time.perf_counter() + random.random(),
time.perf_counter(),
str(uuid.uuid4()),
]
return config
Expand All @@ -456,7 +456,6 @@ def get_answer_token(seed, diff, config):
def generate_answer(seed, diff, config):
diff_len = len(diff)
seed_encoded = seed.encode()

static_config_part1 = (json.dumps(config[:3], separators=(',', ':'), ensure_ascii=False)[:-1] + ',').encode()
static_config_part2 = (',' + json.dumps(config[4:9], separators=(',', ':'), ensure_ascii=False)[1:-1] + ',').encode()
static_config_part3 = (',' + json.dumps(config[10:], separators=(',', ':'), ensure_ascii=False)[1:]).encode()
Expand All @@ -465,7 +464,8 @@ def generate_answer(seed, diff, config):

for i in range(500000):
dynamic_json_i = str(i).encode()
final_json_bytes = static_config_part1 + dynamic_json_i + static_config_part2 + dynamic_json_i + static_config_part3
dynamic_json_j = str(i >> 1).encode()
final_json_bytes = static_config_part1 + dynamic_json_i + static_config_part2 + dynamic_json_j + static_config_part3
base_encode = pybase64.b64encode(final_json_bytes)
hash_value = hashlib.sha3_512(seed_encoded + base_encode).digest()
if hash_value[:diff_len] <= target_diff:
Expand Down

0 comments on commit 336875f

Please sign in to comment.