p115cipher 0.0.2.2__tar.gz → 0.0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p115cipher
3
- Version: 0.0.2.2
3
+ Version: 0.0.2.4
4
4
  Summary: 115 cipher module.
5
5
  Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/p115cipher
6
6
  License: MIT
@@ -80,7 +80,7 @@ def bytes_xor_reverse(v1: Buffer, v2: Buffer, /, size: int = 0) -> Buffer:
80
80
  v2 = v2[:size]
81
81
  else:
82
82
  size = len(v1)
83
- return to_bytes(from_bytes(v1) ^ from_bytes(v2), size, "little")
83
+ return to_bytes(from_bytes(v1) ^ from_bytes(v2), size, byteorder="little")
84
84
 
85
85
 
86
86
  def xor(src: Buffer, key: Buffer, /) -> bytearray:
@@ -76,9 +76,9 @@ def ecdh_encode_token(timestamp: int, /) -> bytes:
76
76
  "用时间戳生成 token,并包含由 ECDH 生成的公钥"
77
77
  token = bytearray()
78
78
  token += b"\x1d\x03\x0e\x80\xa1x\xdc\xee\xce\xcd\xa3w\xde\x12\x8d\x00s\x00\x00\x00"
79
- token += to_bytes(timestamp, 4, "little")
79
+ token += to_bytes(timestamp, 4, byteorder="little")
80
80
  token += b"\x8e\xd9\xdd\xcfU\xaea\xedF\xea\x12\x1a\x1c\xfc\x81\x00\x01\x00\x00\x00"
81
- token += to_bytes(crc32(b"^j>WD3Kr?J2gLFjD4W2y@" + token), 4, "little")
81
+ token += to_bytes(crc32(b"^j>WD3Kr?J2gLFjD4W2y@" + token), 4, byteorder="little")
82
82
  return b64encode(token)
83
83
 
84
84
  def make_upload_payload(payload: dict, /) -> dict:
@@ -91,7 +91,7 @@ def make_upload_payload(payload: dict, /) -> dict:
91
91
  payload["sig"] = sig_sha1.hexdigest().upper()
92
92
  token_md5 = md5(MD5_SALT)
93
93
  token_md5.update(bytes("{fileid}{filesize}{sign_key}{sign_val}{userid}{t}".format_map(payload), "ascii"))
94
- token_md5.update(b2a_hex(md5(bytes(payload["userid"], "ascii")).digest()))
94
+ token_md5.update(b2a_hex(md5(bytes(str(payload["userid"]), "ascii")).digest()))
95
95
  token_md5.update(bytes(str(payload["appversion"]), "ascii"))
96
96
  payload["token"] = token_md5.hexdigest()
97
97
  return {
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p115cipher"
3
- version = "0.0.2.2"
3
+ version = "0.0.2.4"
4
4
  description = "115 cipher module."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes