16384 encode and decode
Project description
✨ pybase16384 ✨
The python binding for base16384
一种神奇的编码
使用
- 编码/解码文本
>>> import pybase16384 as pybs
>>> pybs.encode_string('hello!!')
'栙擆羼漡'
>>> pybs.decode_string('栙擆羼漡')
'hello!!'
- 编码文件
from io import BytesIO
import pybase16384 as pybs
with open("input.pcm", "rb") as f:
data = f.read()
for i in range(1):
pybs.encode_file(BytesIO(data), open("output2.pcm", 'wb'), True)
- 解码文件
from io import BytesIO
import pybase16384 as pybs
with open("output2.pcm", "rb") as f:
data = f.read()
for i in range(1):
pybs.decode_file(BytesIO(data), open("input2.pcm", 'wb'))
公开函数
def encode(data: bytes) -> bytes: ...
def decode(data: bytes) -> bytes: ...
def decode_file(input: BinaryIO, output: BinaryIO, buf_rate: int = 10) -> None: ...
def encode_file(input: BinaryIO, output: BinaryIO, boolwrite_head: bool = False, buf_rate: int = 10) -> None: ...
def encode_from_string(data: str, write_head: bool = False) -> bytes: ...
def encode_to_string(data: bytes) -> str: ...
def encode_string(data: str) -> str: ...
def decode_from_bytes(data: bytes) -> str: ...
def decode_from_string(data: str) -> bytes: ...
def decode_string(data: str) -> str: ...
-
write_head将显式指明编码出的文本格式(utf16be),以便文本编辑器(如记事本)能够正确渲染,一般在写入文件时使用。
-
buf_rate指定读取文件的策略。当它为n时,则表示一次读取7n或者8n个字节。如果读到的字节长度小于预期,则说明长度不够, 此时,n将减半,恢复文件指针,重新读取。如果当n=1时长度仍然不够,就地encode/decode处理之。
内部函数
- 他们直接来自底层的C库,高性能,但是一般不需要在外部使用
def _encode(data: BufferProtocol) -> bytes: ...
def _decode(data: BufferProtocol) -> bytes: ...
_decode
在解码b'='
开头的数据时不安全:解释器异常
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
pybase16384-0.1.1rc4.tar.gz
(128.7 kB
view hashes)
Built Distributions
Close
Hashes for pybase16384-0.1.1rc4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59a9b171c37a052d539f1049da50d0223c3e43eed537b9540c1d2cca7840482f |
|
MD5 | 7a61c77e1b538972f7bbf89f06d5407f |
|
BLAKE2b-256 | dde1a27e8a3f4e9237b0f9a567e6b63885d0e9112911f85526af784c721a514b |
Close
Hashes for pybase16384-0.1.1rc4-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d001a19046fa271a49f7a8637fcdf90d288a7b67b59cf17db9baa4e4c522db1f |
|
MD5 | 045b11f17cfe4e7c5f008688921baa8e |
|
BLAKE2b-256 | 06210884879ce14e5e58b0968d0335e31fca8981ffe40ea587cd2d891edca83f |
Close
Hashes for pybase16384-0.1.1rc4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97fd79c95cc86b17aa399fb2f06a364c1aab6c8c8e5c5d6ec7910ce19c8e0529 |
|
MD5 | c2564bbe41aa7f67d30e13b5e9214457 |
|
BLAKE2b-256 | a3d5504067f823cc4645a3d8dfa391d319a60a0514e03de7697bebf0e084f0f0 |
Close
Hashes for pybase16384-0.1.1rc4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d32a5bbee9d84c54facb299e48643ef184d0eacd3c0d540545ee5e56c9642faf |
|
MD5 | 3484d58bfe14a42bf88b6e7954ab4483 |
|
BLAKE2b-256 | 3444ad46516a1de5d666371beee2230d9431b61c030041eecbaa01183cc63137 |
Close
Hashes for pybase16384-0.1.1rc4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b71b5dd3267279e3f66f4ad9d73c0b6459c6ea421bb534f01cf1194f0351553 |
|
MD5 | 5bf3ecf75c175150b8757f0598cea70d |
|
BLAKE2b-256 | 9a2458b96a425b17168fd77283c37ea08fbefa361cef910e2e2fded14dd771fa |
Close
Hashes for pybase16384-0.1.1rc4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0befd8f0f8ba8a391d2c2f46b783055e4dc1d2bc5973981ea48bc07d27faf4b3 |
|
MD5 | c5c87250c5a5b62484b7b1a8a7f9ad41 |
|
BLAKE2b-256 | 8b55c072e8fec691e7b23283bd68e31d04c38d2b5d2d95c9d40b55bb9013691b |
Close
Hashes for pybase16384-0.1.1rc4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25a69ec9a9ec1c4d9549a60070bfa554b27eee1d96573e6817379f79ccc40bc8 |
|
MD5 | caa071ef4f9a28a759f9a8aadee353d3 |
|
BLAKE2b-256 | ebf722a00085e04a111f7810b496f20597c52158d013b5d9f08ba288b448f9a1 |
Close
Hashes for pybase16384-0.1.1rc4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4079b6c22786a75d5593446cbb1eb9ead0fa70a241892a0583f9ba16d3041314 |
|
MD5 | f93fc2347a88dbc9b4e8f5749f67e695 |
|
BLAKE2b-256 | a6f86ab115cf962fcd5a5ff9b4a0683335f6605a0dbab5a8dd8916c24bf16fb4 |
Close
Hashes for pybase16384-0.1.1rc4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 964d0284442c7068159f52709e101851820427a2612f9645323c67a801283ff4 |
|
MD5 | e52c079932f018be9d9fea06461e8687 |
|
BLAKE2b-256 | eb2803d5c4cee59703489443e9dee6fb9419aa6ae3ac77ecb567d969cf876bfa |
Close
Hashes for pybase16384-0.1.1rc4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c9da4649e0b0906426945b7956906e42627373839ab478d814423859e4ee225 |
|
MD5 | 55bed47c8c15e2c7a497eafd2b5de3b3 |
|
BLAKE2b-256 | 2da948e9c50591071932eba6a442667598fec2f8c16bf21ef31f48c8a3780c07 |
Close
Hashes for pybase16384-0.1.1rc4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c74d34c9aec37a7aaae564f94317ee24836bec303ac9b8aaf673cf5ce8e6b4 |
|
MD5 | 1a9283d72c14c2f2259fb54c47715950 |
|
BLAKE2b-256 | 3ec6fc030b2055dbed87d9986c86ad958d129274898b965a24e633406e20411d |
Close
Hashes for pybase16384-0.1.1rc4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df603a2df462fd2c7dd51c39dd82929a79b2230216ab0a9d79d4067dff9d5e5c |
|
MD5 | 5872368037b906e48631c40ebac437f7 |
|
BLAKE2b-256 | de68dd2dba068a3507858f59ab4eae4991ab25f085ed60073ccd05bf1678c1aa |
Close
Hashes for pybase16384-0.1.1rc4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67cb455ea96f4546e6518e78e88ecb6f023c5224e40c20a32232c5c3a6e73186 |
|
MD5 | befa54dbee7d4950d02fa76722524c75 |
|
BLAKE2b-256 | 29430661b576a0dfa1cd610f460e8e531b68a38f96ac8d8a4d403359323e9a41 |
Close
Hashes for pybase16384-0.1.1rc4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e911551eb8a5b15580cd7f071d85109762045e0d46fb8d9ca7734bb8e9aaca |
|
MD5 | c338a93726502cb2e0ced557991dec70 |
|
BLAKE2b-256 | bf78e5b632ac6d652be35ca5974856a28385b0b66ae1b3f07f00f76d31478fbb |
Close
Hashes for pybase16384-0.1.1rc4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 045a250714232dbb02c15c39b920e40cff88104ff17756798ba4c936a16b35a4 |
|
MD5 | 583dc861910eca1e588163eee0d07946 |
|
BLAKE2b-256 | 9c411ca5a8ef2ce61b55234ea5115766c01b2fe46c87f195e9c53f981748a0a0 |