pybase16384 0.3.3__cp311-cp311-macosx_10_9_universal2.whl → 0.3.5__cp311-cp311-macosx_10_9_universal2.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.
- pybase16384/__init__.py +1 -1
- pybase16384/backends/cffi/__init__.py +7 -7
- pybase16384/backends/cffi/{_core_cffi.abi3.so → _core.abi3.so} +0 -0
- pybase16384/backends/cffi/build.py +3 -3
- pybase16384/backends/cython/__init__.py +1 -1
- pybase16384/backends/cython/_core.abi3.so +0 -0
- pybase16384/backends/cython/{_core_cy.c → _core.c} +25936 -18871
- pybase16384/backends/cython/{_core_cy.pyx → _core.pyx} +6 -10
- pybase16384/backends/cython/base16384.pxd +2 -2
- {pybase16384-0.3.3.dist-info → pybase16384-0.3.5.dist-info}/METADATA +3 -3
- pybase16384-0.3.5.dist-info/RECORD +16 -0
- {pybase16384-0.3.3.dist-info → pybase16384-0.3.5.dist-info}/WHEEL +1 -1
- pybase16384/backends/cython/_core_cy.cpython-311-darwin.so +0 -0
- pybase16384-0.3.3.dist-info/RECORD +0 -16
- /pybase16384/backends/cython/{_core_cy.pyi → _core.pxi} +0 -0
- {pybase16384-0.3.3.dist-info → pybase16384-0.3.5.dist-info}/LICENSE +0 -0
- {pybase16384-0.3.3.dist-info → pybase16384-0.3.5.dist-info}/top_level.txt +0 -0
pybase16384/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@ Copyright (c) 2008-2021 synodriver <synodriver@gmail.com>
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import IO
|
|
6
6
|
|
|
7
|
-
from pybase16384.backends.cffi.
|
|
7
|
+
from pybase16384.backends.cffi._core import ffi, lib
|
|
8
8
|
|
|
9
9
|
__version__ = "0.1.0"
|
|
10
10
|
|
|
@@ -19,13 +19,13 @@ def _encode(data: bytes) -> bytes:
|
|
|
19
19
|
output_buf = ffi.new(f"char[{output_size}]")
|
|
20
20
|
if output_buf == ffi.NULL:
|
|
21
21
|
raise MemoryError
|
|
22
|
-
count = lib.base16384_encode(ffi.from_buffer(data), length, output_buf
|
|
22
|
+
count = lib.base16384_encode(ffi.from_buffer(data), length, output_buf)
|
|
23
23
|
return ffi.unpack(output_buf, count)
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def _encode_into(data: bytes, out: bytearray) -> int:
|
|
27
27
|
return lib.base16384_encode(
|
|
28
|
-
ffi.from_buffer(data), len(data), ffi.from_buffer(out)
|
|
28
|
+
ffi.from_buffer(data), len(data), ffi.from_buffer(out)
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
|
|
@@ -35,13 +35,13 @@ def _decode(data: bytes) -> bytes:
|
|
|
35
35
|
output_buf = ffi.new(f"char[{output_size}]")
|
|
36
36
|
if output_buf == ffi.NULL:
|
|
37
37
|
raise MemoryError
|
|
38
|
-
count = lib.base16384_decode(ffi.from_buffer(data), length, output_buf
|
|
38
|
+
count = lib.base16384_decode(ffi.from_buffer(data), length, output_buf)
|
|
39
39
|
return ffi.unpack(output_buf, count)
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def _decode_into(data: bytes, out: bytearray) -> int:
|
|
43
43
|
return lib.base16384_decode(
|
|
44
|
-
ffi.from_buffer(data), len(data), ffi.from_buffer(out)
|
|
44
|
+
ffi.from_buffer(data), len(data), ffi.from_buffer(out)
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
|
|
@@ -93,7 +93,7 @@ def encode_file(input: IO, output: IO, write_head: bool = False, buf_rate: int =
|
|
|
93
93
|
continue
|
|
94
94
|
|
|
95
95
|
count = lib.base16384_encode(
|
|
96
|
-
ffi.from_buffer(chunk), size, output_buf
|
|
96
|
+
ffi.from_buffer(chunk), size, output_buf
|
|
97
97
|
)
|
|
98
98
|
output.write(ffi.unpack(output_buf, count))
|
|
99
99
|
if size < 7:
|
|
@@ -147,7 +147,7 @@ def decode_file(input: IO, output: IO, buf_rate: int = 10):
|
|
|
147
147
|
input.seek(-2, 1)
|
|
148
148
|
|
|
149
149
|
count = lib.base16384_decode(
|
|
150
|
-
ffi.from_buffer(chunk), size, output_buf
|
|
150
|
+
ffi.from_buffer(chunk), size, output_buf
|
|
151
151
|
)
|
|
152
152
|
output.write(ffi.unpack(output_buf, count))
|
|
153
153
|
|
|
Binary file
|
|
@@ -46,8 +46,8 @@ enum base16384_err_t {
|
|
|
46
46
|
typedef enum base16384_err_t base16384_err_t;
|
|
47
47
|
int base16384_encode_len(int dlen);
|
|
48
48
|
int base16384_decode_len(int dlen, int offset);
|
|
49
|
-
int base16384_encode(const char* data, int dlen, char* buf
|
|
50
|
-
int base16384_decode(const char* data, int dlen, char* buf
|
|
49
|
+
int base16384_encode(const char* data, int dlen, char* buf);
|
|
50
|
+
int base16384_decode(const char* data, int dlen, char* buf);
|
|
51
51
|
base16384_err_t base16384_encode_file(const char* input, const char* output, char* encbuf, char* decbuf);
|
|
52
52
|
base16384_err_t base16384_decode_file(const char* input, const char* output, char* encbuf, char* decbuf);
|
|
53
53
|
|
|
@@ -96,7 +96,7 @@ int get_decsize()
|
|
|
96
96
|
"""
|
|
97
97
|
|
|
98
98
|
ffibuilder.set_source(
|
|
99
|
-
"pybase16384.backends.cffi.
|
|
99
|
+
"pybase16384.backends.cffi._core",
|
|
100
100
|
source,
|
|
101
101
|
sources=[f"./base16384/base14{CPUBIT}.c", "./base16384/file.c"],
|
|
102
102
|
include_dirs=["./base16384"],
|
|
Binary file
|