pybase16384 0.3.3__pp38-pypy38_pp73-win_amd64.whl → 0.3.5__pp38-pypy38_pp73-win_amd64.whl

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.

Potentially problematic release.


This version of pybase16384 might be problematic. Click here for more details.

@@ -51,8 +51,7 @@ cpdef inline bytes _encode(const uint8_t[::1] data):
51
51
  with nogil:
52
52
  count = b14_encode(<const char*> &data[0],
53
53
  <int>length,
54
- output_buf,
55
- <int>output_size) # encode 整数倍的那个
54
+ output_buf) # encode 整数倍的那个
56
55
  try:
57
56
  return <bytes>output_buf[:count]
58
57
  finally:
@@ -68,8 +67,7 @@ cpdef inline bytes _decode(const uint8_t[::1] data):
68
67
  with nogil:
69
68
  count = b14_decode(<const char *> &data[0],
70
69
  <int> length,
71
- output_buf,
72
- <int> output_size) # decode
70
+ output_buf) # decode
73
71
  try:
74
72
  return <bytes> output_buf[:count]
75
73
  finally:
@@ -84,8 +82,7 @@ cpdef inline int _encode_into(const uint8_t[::1] data, uint8_t[::1] dest) except
84
82
  with nogil:
85
83
  return b14_encode(<const char *> &data[0],
86
84
  <int> input_size,
87
- <char *> &dest[0],
88
- <int> output_buf_size)
85
+ <char *> &dest[0])
89
86
 
90
87
  cpdef inline int _decode_into(const uint8_t[::1] data, uint8_t[::1] dest) except -1:
91
88
  cdef size_t input_size = data.shape[0]
@@ -96,8 +93,7 @@ cpdef inline int _decode_into(const uint8_t[::1] data, uint8_t[::1] dest) except
96
93
  with nogil:
97
94
  return b14_decode(<const char *> &data[0],
98
95
  <int> input_size,
99
- <char *> &dest[0],
100
- <int> output_buf_size)
96
+ <char *> &dest[0])
101
97
 
102
98
 
103
99
  def encode_file(object input,
@@ -140,7 +136,7 @@ def encode_file(object input,
140
136
  continue
141
137
  chunk_ptr = <const char*>PyBytes_AS_STRING(chunk)
142
138
  with nogil:
143
- count = b14_encode(chunk_ptr, <int>size, output_buf, <int> output_size)
139
+ count = b14_encode(chunk_ptr, <int>size, output_buf)
144
140
  output.write(<bytes>output_buf[:count])
145
141
  if size < 7:
146
142
  break
@@ -194,7 +190,7 @@ def decode_file(object input,
194
190
  input.seek(-2, 1)
195
191
  chunk_ptr = <const char *> PyBytes_AS_STRING(chunk)
196
192
  with nogil:
197
- count = b14_decode(chunk_ptr, <int> size, output_buf, <int> output_size)
193
+ count = b14_decode(chunk_ptr, <int> size, output_buf)
198
194
  output.write(<bytes>output_buf[:count])
199
195
  finally:
200
196
  PyMem_Free(output_buf)
@@ -21,9 +21,9 @@ cdef extern from "base16384.h" nogil:
21
21
  int b14_decode_len "base16384_decode_len" (int dlen, int offset)
22
22
 
23
23
  # encode data and write result into buf
24
- int b14_encode "base16384_encode" (const char* data, int dlen, char* buf, int blen)
24
+ int b14_encode "base16384_encode" (const char* data, int dlen, char* buf)
25
25
  # decode data and write result into buf
26
- int b14_decode "base16384_decode" (const char* data, int dlen, char* buf, int blen)
26
+ int b14_decode "base16384_decode" (const char* data, int dlen, char* buf)
27
27
 
28
28
  base16384_err_t b14_encode_file "base16384_encode_file" (const char * input, const char * output, char * encbuf, char * decbuf)
29
29
  base16384_err_t b14_decode_file "base16384_decode_file" (const char * input, const char * output, char * encbuf, char * decbuf)
@@ -1,152 +1,152 @@
1
- Metadata-Version: 2.1
2
- Name: pybase16384
3
- Version: 0.3.3
4
- Summary: fast base16384 encode and decode
5
- Home-page: https://github.com/synodriver/pybase16384
6
- Author: synodriver
7
- Author-email: diguohuangjiajinweijun@gmail.com
8
- License: GPLv3
9
- Keywords: encode,decode,base16384
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Operating System :: OS Independent
12
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
- Classifier: Topic :: Security :: Cryptography
14
- Classifier: Programming Language :: C
15
- Classifier: Programming Language :: Cython
16
- Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
- Classifier: Programming Language :: Python :: 3.10
22
- Classifier: Programming Language :: Python :: Implementation :: CPython
23
- Classifier: Programming Language :: Python :: Implementation :: PyPy
24
- Requires-Python: >=3.6
25
- Description-Content-Type: text/markdown
26
- License-File: LICENSE
27
- Requires-Dist: cffi (>=1.0.0)
28
-
29
- <h1 align="center"><i>✨ pybase16384 ✨ </i></h1>
30
-
31
- <h3 align="center">The python binding for <a href="https://github.com/fumiama/base16384">base16384</a> </h3>
32
-
33
- <h3 align="center"><i>一种神奇的编码 </i></h3>
34
-
35
- [![pypi](https://img.shields.io/pypi/v/pybase16384.svg)](https://pypi.org/project/pybase16384/)
36
- ![python](https://img.shields.io/pypi/pyversions/pybase16384)
37
- ![implementation](https://img.shields.io/pypi/implementation/pybase16384)
38
- ![wheel](https://img.shields.io/pypi/wheel/pybase16384)
39
- ![license](https://img.shields.io/github/license/synodriver/pybase16384.svg)
40
- ![action](https://img.shields.io/github/workflow/status/synodriver/pybase16384/build%20wheel)
41
-
42
-
43
- ### 使用
44
-
45
- - 编码/解码文本
46
- ```python
47
- >>> import pybase16384 as pybs
48
- >>> pybs.encode_string('hello!!')
49
- '栙擆羼漡'
50
- >>> pybs.decode_string('栙擆羼漡')
51
- 'hello!!'
52
- ```
53
-
54
- - 编码文件
55
-
56
- ```python
57
- from io import BytesIO
58
-
59
- import pybase16384 as pybs
60
-
61
- with open("input.pcm", "rb") as f:
62
- data = f.read()
63
- for i in range(1):
64
- pybs.encode_file(BytesIO(data), open("output2.pcm", 'wb'), True)
65
- ```
66
- - 解码文件
67
-
68
- ```python
69
- from io import BytesIO
70
-
71
- import pybase16384 as pybs
72
-
73
- with open("output2.pcm", "rb") as f:
74
- data = f.read()
75
- for i in range(1):
76
- pybs.decode_file(BytesIO(data), open("input2.pcm", 'wb'))
77
- ```
78
-
79
- ### 公开函数
80
- ```python
81
- def encode_len(dlen: int) -> int: ...
82
-
83
- def decode_len(dlen: int, offset: int) -> int: ...
84
-
85
- def encode(data: bytes) -> bytes: ...
86
-
87
- def decode(data: bytes) -> bytes: ...
88
-
89
- def decode_file(input: BinaryIO, output: BinaryIO, buf_rate: int = 10) -> None: ...
90
-
91
- def encode_file(input: BinaryIO, output: BinaryIO, boolwrite_head: bool = False, buf_rate: int = 10) -> None: ...
92
-
93
- def encode_from_string(data: str, write_head: bool = False) -> bytes: ...
94
-
95
- def encode_to_string(data: bytes) -> str: ...
96
-
97
- def encode_string(data: str) -> str: ...
98
-
99
- def decode_from_bytes(data: bytes) -> str: ...
100
-
101
- def decode_from_string(data: str) -> bytes: ...
102
-
103
- def decode_string(data: str) -> str: ...
104
-
105
- def encode_local_file(inp: Union[str, bytes, Path], out: Union[str, bytes, Path], encsize: int, decsize: int) -> None: ...
106
-
107
- def decode_local_file(inp: Union[str, bytes, Path], out: Union[str, bytes, Path], encsize: int, decsize: int) -> None: ...
108
-
109
- def encode_fd(inp: int, out: int) -> None: ...
110
-
111
- def decode_fd(inp: int, out: int) -> None: ...
112
- ```
113
- - write_head将显式指明编码出的文本格式(utf16be),以便文本编辑器(如记事本)能够正确渲染,一般在写入文件时使用。
114
-
115
- - buf_rate指定读取文件的策略。当它为n时,则表示一次读取7n或者8n个字节。如果读到的字节长度小于预期,则说明长度不够,
116
- 此时,n将减半,恢复文件指针,重新读取。如果当n=1时长度仍然不够,就地encode/decode处理之。
117
-
118
- - ```encode_len```和```decode_len```用于计算输出的长度
119
-
120
- ### 内部函数
121
-
122
- - 他们直接来自底层的C库,高性能,但是一般不需要在外部使用(除非是增加性能)
123
-
124
- ```python
125
- def _encode(data: BufferProtocol) -> bytes: ...
126
-
127
- def _decode(data: BufferProtocol) -> bytes: ...
128
-
129
- def _encode_into(data: BufferProtocol, dest: BufferProtocol) -> int: ...
130
-
131
- def _decode_into(data: BufferProtocol, dest: BufferProtocol) -> int: ...
132
-
133
- def is_64bits() -> bool: ...
134
- ```
135
- - ```_decode```在解码```b'='```开头的数据时***不安全***:***解释器异常***
136
- - ```_encode_into```和```_decode_into```直接操作缓冲区对象的底层指针,0拷贝,当然也和上面一样的问题,他们是没有检查的
137
-
138
- ### ✨ v0.3更新 ✨
139
- 融合了 [CFFI](https://github.com/synodriver/pybase16384-cffi) 版本的成果,现在一个包可以同时在cpython和pypy上运行
140
-
141
- ### 本机编译
142
- ```
143
- python -m pip install setuptools wheel cython cffi
144
- git clone https://github.com/synodriver/pybase16384
145
- cd pybase16384
146
- git submodule update --init --recursive
147
- python setup.py bdist_wheel --use-cython --use-cffi
148
- ```
149
- - 为了在windows上编译,需要加点料,把 [这个](https://gist.github.com/synodriver/8f1afae7b1a221754cb04ce417dc7e4d) 放进msvc的目录
150
-
151
- ### 后端选择
152
- 默认由py实现决定,在cpython上自动选择cython后端,在pypy上自动选择cffi后端,使用```B14_USE_CFFI```环境变量可以强制选择cffi
1
+ Metadata-Version: 2.1
2
+ Name: pybase16384
3
+ Version: 0.3.5
4
+ Summary: fast base16384 encode and decode
5
+ Home-page: https://github.com/synodriver/pybase16384
6
+ Author: synodriver
7
+ Author-email: diguohuangjiajinweijun@gmail.com
8
+ License: GPLv3
9
+ Keywords: encode,decode,base16384
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
+ Classifier: Topic :: Security :: Cryptography
14
+ Classifier: Programming Language :: C
15
+ Classifier: Programming Language :: Cython
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Requires-Python: >=3.6
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: cffi (>=1.0.0)
28
+
29
+ <h1 align="center"><i>✨ pybase16384 ✨ </i></h1>
30
+
31
+ <h3 align="center">The python binding for <a href="https://github.com/fumiama/base16384">base16384</a> </h3>
32
+
33
+ <h3 align="center"><i>一种神奇的编码 </i></h3>
34
+
35
+ [![pypi](https://img.shields.io/pypi/v/pybase16384.svg)](https://pypi.org/project/pybase16384/)
36
+ ![python](https://img.shields.io/pypi/pyversions/pybase16384)
37
+ ![implementation](https://img.shields.io/pypi/implementation/pybase16384)
38
+ ![wheel](https://img.shields.io/pypi/wheel/pybase16384)
39
+ ![license](https://img.shields.io/github/license/synodriver/pybase16384.svg)
40
+ ![action](https://img.shields.io/github/workflow/status/synodriver/pybase16384/build%20wheel)
41
+
42
+
43
+ ### 使用
44
+
45
+ - 编码/解码文本
46
+ ```python
47
+ >>> import pybase16384 as pybs
48
+ >>> pybs.encode_string('hello!!')
49
+ '栙擆羼漡'
50
+ >>> pybs.decode_string('栙擆羼漡')
51
+ 'hello!!'
52
+ ```
53
+
54
+ - 编码文件
55
+
56
+ ```python
57
+ from io import BytesIO
58
+
59
+ import pybase16384 as pybs
60
+
61
+ with open("input.pcm", "rb") as f:
62
+ data = f.read()
63
+ for i in range(1):
64
+ pybs.encode_file(BytesIO(data), open("output2.pcm", 'wb'), True)
65
+ ```
66
+ - 解码文件
67
+
68
+ ```python
69
+ from io import BytesIO
70
+
71
+ import pybase16384 as pybs
72
+
73
+ with open("output2.pcm", "rb") as f:
74
+ data = f.read()
75
+ for i in range(1):
76
+ pybs.decode_file(BytesIO(data), open("input2.pcm", 'wb'))
77
+ ```
78
+
79
+ ### 公开函数
80
+ ```python
81
+ def encode_len(dlen: int) -> int: ...
82
+
83
+ def decode_len(dlen: int, offset: int) -> int: ...
84
+
85
+ def encode(data: bytes) -> bytes: ...
86
+
87
+ def decode(data: bytes) -> bytes: ...
88
+
89
+ def decode_file(input: BinaryIO, output: BinaryIO, buf_rate: int = 10) -> None: ...
90
+
91
+ def encode_file(input: BinaryIO, output: BinaryIO, boolwrite_head: bool = False, buf_rate: int = 10) -> None: ...
92
+
93
+ def encode_from_string(data: str, write_head: bool = False) -> bytes: ...
94
+
95
+ def encode_to_string(data: bytes) -> str: ...
96
+
97
+ def encode_string(data: str) -> str: ...
98
+
99
+ def decode_from_bytes(data: bytes) -> str: ...
100
+
101
+ def decode_from_string(data: str) -> bytes: ...
102
+
103
+ def decode_string(data: str) -> str: ...
104
+
105
+ def encode_local_file(inp: Union[str, bytes, Path], out: Union[str, bytes, Path], encsize: int, decsize: int) -> None: ...
106
+
107
+ def decode_local_file(inp: Union[str, bytes, Path], out: Union[str, bytes, Path], encsize: int, decsize: int) -> None: ...
108
+
109
+ def encode_fd(inp: int, out: int) -> None: ...
110
+
111
+ def decode_fd(inp: int, out: int) -> None: ...
112
+ ```
113
+ - write_head将显式指明编码出的文本格式(utf16be),以便文本编辑器(如记事本)能够正确渲染,一般在写入文件时使用。
114
+
115
+ - buf_rate指定读取文件的策略。当它为n时,则表示一次读取7n或者8n个字节。如果读到的字节长度小于预期,则说明长度不够,
116
+ 此时,n将减半,恢复文件指针,重新读取。如果当n=1时长度仍然不够,就地encode/decode处理之。
117
+
118
+ - ```encode_len```和```decode_len```用于计算输出的长度
119
+
120
+ ### 内部函数
121
+
122
+ - 他们直接来自底层的C库,高性能,但是一般不需要在外部使用(除非是增加性能)
123
+
124
+ ```python
125
+ def _encode(data: BufferProtocol) -> bytes: ...
126
+
127
+ def _decode(data: BufferProtocol) -> bytes: ...
128
+
129
+ def _encode_into(data: BufferProtocol, dest: BufferProtocol) -> int: ...
130
+
131
+ def _decode_into(data: BufferProtocol, dest: BufferProtocol) -> int: ...
132
+
133
+ def is_64bits() -> bool: ...
134
+ ```
135
+ - ```_decode```在解码```b'='```开头的数据时***不安全***:***解释器异常***
136
+ - ```_encode_into```和```_decode_into```直接操作缓冲区对象的底层指针,0拷贝,当然也和上面一样的问题,他们是没有检查的
137
+
138
+ ### ✨ v0.3更新 ✨
139
+ 融合了 [CFFI](https://github.com/synodriver/pybase16384-cffi) 版本的成果,现在一个包可以同时在cpython和pypy上运行
140
+
141
+ ### 本机编译
142
+ ```
143
+ python -m pip install setuptools wheel cython cffi
144
+ git clone https://github.com/synodriver/pybase16384
145
+ cd pybase16384
146
+ git submodule update --init --recursive
147
+ python setup.py bdist_wheel --use-cython --use-cffi
148
+ ```
149
+ - 为了在windows上编译,需要加点料,把 [这个](https://gist.github.com/synodriver/8f1afae7b1a221754cb04ce417dc7e4d) 放进msvc的目录
150
+
151
+ ### 后端选择
152
+ 默认由py实现决定,在cpython上自动选择cython后端,在pypy上自动选择cffi后端,使用```B14_USE_CFFI```环境变量可以强制选择cffi
@@ -0,0 +1,16 @@
1
+ pybase16384/__init__.py,sha256=l9vuFXikNNKgrtNT-Ix6EPQwc-G_QipKoHaYzSlVtIQ,2540
2
+ pybase16384/backends/__init__.py,sha256=9aG9WOI42Hcgaj9QGw99OIvKZTG-sYNlLBUctorc4Kg,56
3
+ pybase16384/backends/cffi/__init__.py,sha256=FZdJJtnYanH8-3Lls_UPjm0xOicDOofwrOziIPHBUk8,7604
4
+ pybase16384/backends/cffi/_core.pypy38-pp73-win_amd64.pyd,sha256=UR6LQ65YCVZdKh3lWBTz5Iya_nPPjtPuzUfDFYxeygM,18944
5
+ pybase16384/backends/cffi/build.py,sha256=YNZh1_n6d5WMvqEEgvx3MyY8GeeR0mavjiJ9i6-xpP4,3095
6
+ pybase16384/backends/cython/__init__.py,sha256=zoKnXRa8Zz5ZsMFj_8cjveOZ0XJfpx5Ic7jmub2d8ec,353
7
+ pybase16384/backends/cython/_core.c,sha256=3CpP9r0tvL2IQzf2vHe8f76s3mUJo_Bt9hu_z9zpEsA,1296347
8
+ pybase16384/backends/cython/_core.pxi,sha256=SPgwG7QKofRYdJDRrhx2TWRvOuBuwTjRGg2WvGUrQw4,542
9
+ pybase16384/backends/cython/_core.pypy38-pp73-win_amd64.pyd,sha256=Yb0gJ93iung-l7bKIaibCkjCctqaTl3nxa3gdyuxS_0,168960
10
+ pybase16384/backends/cython/_core.pyx,sha256=VYqH9aNFqavFZRC7-VoW7S8WwvaJITXTjo9tjI7LFy8,11775
11
+ pybase16384/backends/cython/base16384.pxd,sha256=IiicckRLe7L9Pi6-OuPC6PIpQgqzzHRsJUcHyKQ5uRI,2326
12
+ pybase16384-0.3.5.dist-info/LICENSE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
13
+ pybase16384-0.3.5.dist-info/METADATA,sha256=pssEzcLOnmL8WmuNZ0v_4JEV16k8xHAJsHTrRwhnxhI,5539
14
+ pybase16384-0.3.5.dist-info/WHEEL,sha256=VdGht2tAV-pZeKh01R_AzgNm9hOgkZNK5FJALyJVlrI,107
15
+ pybase16384-0.3.5.dist-info/top_level.txt,sha256=kXpl7pWjnjpm74qJP0SJg3JhbiWuwKQApJgkJH0B5Mk,12
16
+ pybase16384-0.3.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: pp38-pypy38_pp73-win_amd64
5
5
 
@@ -1,16 +0,0 @@
1
- pybase16384/__init__.py,sha256=7Zp2drxjfnD94BHHy4A4tLH-5qidgQa7ESZbPpi9b3I,2540
2
- pybase16384/backends/__init__.py,sha256=9aG9WOI42Hcgaj9QGw99OIvKZTG-sYNlLBUctorc4Kg,56
3
- pybase16384/backends/cffi/__init__.py,sha256=hV1YWOOdEqr-KT2chu7SmaVI69GuDQN3iaKKWF6MGEw,7681
4
- pybase16384/backends/cffi/_core_cffi.pypy38-pp73-win_amd64.pyd,sha256=pSJsacQ8c3Kt1ACcXkQSWAKZfS40fcqomQk4VIZx2-c,16896
5
- pybase16384/backends/cffi/build.py,sha256=EF5s2lAJh7Y6uFWpWS0Yo4By3kNpr04BjENwfDUqTe0,3120
6
- pybase16384/backends/cython/__init__.py,sha256=PGNLWLyotqZYPTHSRfayVPZThk-GT9iIcY9ArEMVbgc,356
7
- pybase16384/backends/cython/_core_cy.c,sha256=aWapigIhVVNkK65m7FqBbYUSyrAi5GGn1udSm0tqLp8,1016758
8
- pybase16384/backends/cython/_core_cy.pyi,sha256=SPgwG7QKofRYdJDRrhx2TWRvOuBuwTjRGg2WvGUrQw4,542
9
- pybase16384/backends/cython/_core_cy.pypy38-pp73-win_amd64.pyd,sha256=Fc68l-NLyg3TOrHIIaimc0jdiO8BvKIMfxpchziYg04,137216
10
- pybase16384/backends/cython/_core_cy.pyx,sha256=2gz5nn77wZo2pRH_4D0sZPt7P9jbdXH7EBfUFZ8lIw4,12044
11
- pybase16384/backends/cython/base16384.pxd,sha256=7Fz1WvyF8H1roLKN-SGYFFeCB1By2B9viJ7VtMCIQkI,2346
12
- pybase16384-0.3.3.dist-info/LICENSE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
13
- pybase16384-0.3.3.dist-info/METADATA,sha256=t1HM6BFIQ7WXmN5olz8qxeX2lDqFynT-4ivXmLo8ByQ,5385
14
- pybase16384-0.3.3.dist-info/WHEEL,sha256=06TODGy9zsn9QCb4Oo1wjtnM2jOjgiTR78nw1cWltRU,107
15
- pybase16384-0.3.3.dist-info/top_level.txt,sha256=kXpl7pWjnjpm74qJP0SJg3JhbiWuwKQApJgkJH0B5Mk,12
16
- pybase16384-0.3.3.dist-info/RECORD,,
File without changes