mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-03-11 16:35:14 +00:00
Update server.py
This commit is contained in:
parent
4e2aeb0fa7
commit
dc0653de09
|
@ -93,14 +93,16 @@ def start(): #Main Program
|
|||
print("\n[*] Graceful Shutdown")
|
||||
sys.exit(1)
|
||||
|
||||
def jsonrpc2_create_id(data):
|
||||
return hashlib.sha1(json.dumps(data).encoding(client_encoding)).hexdigest()
|
||||
|
||||
def jsonrpc2_encode(method, params):
|
||||
data = {
|
||||
"jsonrpc": "2.0",
|
||||
"method": method,
|
||||
"params": params
|
||||
}
|
||||
id = "0x%s" % (hashlib.sha1(json.dumps(data).encoding(client_encoding)).hexdigest())
|
||||
data['id'] = id
|
||||
data['id'] = jsonrpc2_create_id(data)
|
||||
return json.dumps(data)
|
||||
|
||||
def parse_first_data(data):
|
||||
|
|
Loading…
Reference in New Issue
Block a user