Add your description here
Project description
该项目用于将url经过base64转码后可以安全的在http请求参数中传输
encode-decode 过程
原始链接的encode和decode对应方法
from longbao_urllib import UrlEnvelop
import time
host = "http://localhost:8000"
# 创建一个url信封,compress用于对参数进行压缩
wrapper = UrlEnvelop(
f"{host}/api/ad/callback?q1=123&q2=234&q3=456&q4=78911",
compress=True,
)
# 返回可以放在query中的参数
raw = wrapper.url_encode(
f"{host}/api/ad/mock/kuaishou/callback?cid=123&pid=xyzxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxxxxxxxx",
clickid="xx-yy-zz")
decoded_url = wrapper.url_decode(raw, conv_type=1, conv_ts=time.time(), clickid="xx-yy-zz")
参数 wrap-upwrap 过程
from longbao_urllib import UrlEnvelop
host = "http://localhost:8000"
wrapper = UrlEnvelop(
f"{host}/api/ad/callback?q1=123&q2=234&q3=456&q4=78911",
compress=True,
)
# 将原始链接包裹后的新的链接
url1 = wrapper.wrap(
f"{host}/api/ad/mock/kuaishou/callback?callback=123&pid=xyz",
request_id="xx-yy-zz",
)
# 打开后返回原始的链接
url2 = wrapper.unwrap(
url1,
request_id="xx-yy-ww",
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
longbao_urllib-0.1.0.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file longbao_urllib-0.1.0.tar.gz.
File metadata
- Download URL: longbao_urllib-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c248a8b684590f81ec5a67190c5fb4ca39ff09cfc7a7fca98fc868344992d621
|
|
| MD5 |
f193970c6229da4e3bdbdbbb7bc1f28f
|
|
| BLAKE2b-256 |
0a8970ddd292cc0b809d76cfe0ba210f5630083213ffc24261f6b4c820c8fbd6
|
File details
Details for the file longbao_urllib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: longbao_urllib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80dc0e316b6a580dbcdad8f327ff663aa9dd46fbc3b0ed0b407e2896e00a0df7
|
|
| MD5 |
019d87b27413d880fdbb703a0f677687
|
|
| BLAKE2b-256 |
42db141175d9f7193a9de4b3a83d50b46243135d6b1f51088b37229bc3cfd81e
|