pybase16384 0.3.5__cp310-cp310-musllinux_1_1_aarch64.whl → 0.3.6__cp310-cp310-musllinux_1_1_aarch64.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.

@@ -6,18 +6,26 @@ from cpython.object cimport PyObject_HasAttrString
6
6
  from libc.stdint cimport int32_t, uint8_t
7
7
 
8
8
  from pybase16384.backends.cython.base16384 cimport (
9
- b14_decode, b14_decode_fd, b14_decode_file, b14_decode_len, b14_encode,
10
- b14_encode_fd, b14_encode_file, b14_encode_len,
11
- base16384_err_fopen_input_file, base16384_err_fopen_output_file,
12
- base16384_err_get_file_size, base16384_err_map_input_file,
13
- base16384_err_ok, base16384_err_open_input_file, base16384_err_t, BASE16384_ENCBUFSZ,
14
- BASE16384_DECBUFSZ,
9
+ BASE16384_DECBUFSZ, BASE16384_ENCBUFSZ, BASE16384_FLAG_NOHEADER,
10
+ BASE16384_FLAG_SUM_CHECK_ON_REMAIN, BASE16384_SIMPLE_SUM_INIT_VALUE,
11
+ b14_decode, b14_decode_fd, b14_decode_fd_detailed, b14_decode_file,
12
+ b14_decode_file_detailed, b14_decode_len, b14_encode, b14_encode_fd,
13
+ b14_encode_fd_detailed, b14_encode_file, b14_encode_file_detailed,
14
+ b14_encode_len, base16384_err_fopen_input_file,
15
+ base16384_err_fopen_output_file, base16384_err_get_file_size,
16
+ base16384_err_invalid_commandline_parameter,
17
+ base16384_err_invalid_decoding_checksum, base16384_err_invalid_file_name,
18
+ base16384_err_map_input_file, base16384_err_ok,
19
+ base16384_err_open_input_file, base16384_err_read_file, base16384_err_t,
15
20
  base16384_err_write_file, pybase16384_64bits)
16
21
 
17
22
  from pathlib import Path
18
23
 
19
24
  ENCBUFSZ = BASE16384_ENCBUFSZ
20
25
  DECBUFSZ = BASE16384_DECBUFSZ
26
+ FLAG_NOHEADER = BASE16384_FLAG_NOHEADER
27
+ FLAG_SUM_CHECK_ON_REMAIN = BASE16384_FLAG_SUM_CHECK_ON_REMAIN
28
+ SIMPLE_SUM_INIT_VALUE = BASE16384_SIMPLE_SUM_INIT_VALUE
21
29
 
22
30
  cdef inline bytes ensure_bytes(object inp):
23
31
  if isinstance(inp, unicode):
@@ -211,6 +219,14 @@ cdef inline str err_to_str(base16384_err_t ret):
211
219
  return "base16384_err_open_input_file"
212
220
  elif ret == base16384_err_map_input_file:
213
221
  return "base16384_err_map_input_file"
222
+ elif ret == base16384_err_read_file:
223
+ return "base16384_err_read_file"
224
+ elif ret == base16384_err_invalid_file_name:
225
+ return "base16384_err_invalid_file_name"
226
+ elif ret == base16384_err_invalid_commandline_parameter:
227
+ return "base16384_err_invalid_commandline_parameter"
228
+ elif ret == base16384_err_invalid_decoding_checksum:
229
+ return "base16384_err_invalid_decoding_checksum"
214
230
 
215
231
  cpdef inline encode_local_file(object inp, object out):
216
232
  cdef bytes inp_name = ensure_bytes(inp)
@@ -291,3 +307,84 @@ cpdef inline decode_fd(int inp, int out):
291
307
  finally:
292
308
  PyMem_Free(encbuf)
293
309
  PyMem_Free(decbuf)
310
+
311
+ # detailed
312
+ cpdef inline encode_local_file_detailed(object inp, object out, int flag):
313
+ cdef bytes inp_name = ensure_bytes(inp)
314
+ cdef bytes out_name = ensure_bytes(out)
315
+ cdef const char * inp_name_ptr = <const char *> inp_name
316
+ cdef const char * out_name_ptr = <const char *> out_name
317
+ cdef char * encbuf = <char*>PyMem_Malloc(<size_t>BASE16384_ENCBUFSZ)
318
+ if encbuf == NULL:
319
+ raise MemoryError
320
+ cdef char * decbuf = <char*>PyMem_Malloc(<size_t>BASE16384_DECBUFSZ)
321
+ if decbuf == NULL:
322
+ PyMem_Free(encbuf)
323
+ raise MemoryError
324
+ cdef base16384_err_t ret
325
+ try:
326
+ with nogil:
327
+ ret = b14_encode_file_detailed(inp_name_ptr, out_name_ptr, encbuf, decbuf, flag)
328
+ if ret != base16384_err_ok:
329
+ raise ValueError(err_to_str(ret))
330
+ finally:
331
+ PyMem_Free(encbuf)
332
+ PyMem_Free(decbuf)
333
+
334
+ cpdef inline decode_local_file_detailed(object inp, object out, int flag):
335
+ cdef bytes inp_name = ensure_bytes(inp)
336
+ cdef bytes out_name = ensure_bytes(out)
337
+ cdef const char * inp_name_ptr = <const char *> inp_name
338
+ cdef const char * out_name_ptr = <const char *> out_name
339
+ cdef char * encbuf = <char*>PyMem_Malloc(<size_t>BASE16384_ENCBUFSZ)
340
+ if encbuf == NULL:
341
+ raise MemoryError
342
+ cdef char * decbuf = <char*>PyMem_Malloc(<size_t>BASE16384_DECBUFSZ)
343
+ if decbuf == NULL:
344
+ PyMem_Free(encbuf)
345
+ raise MemoryError
346
+ cdef base16384_err_t ret
347
+ try:
348
+ with nogil:
349
+ ret = b14_decode_file_detailed(inp_name_ptr, out_name_ptr, encbuf, decbuf, flag)
350
+ if ret != base16384_err_ok:
351
+ raise ValueError(err_to_str(ret))
352
+ finally:
353
+ PyMem_Free(encbuf)
354
+ PyMem_Free(decbuf)
355
+
356
+ cpdef inline encode_fd_detailed(int inp, int out, int flag):
357
+ cdef char * encbuf = <char *> PyMem_Malloc(<size_t>BASE16384_ENCBUFSZ)
358
+ if encbuf == NULL:
359
+ raise MemoryError
360
+ cdef char * decbuf = <char *> PyMem_Malloc(<size_t>BASE16384_DECBUFSZ)
361
+ if decbuf == NULL:
362
+ PyMem_Free(encbuf)
363
+ raise MemoryError
364
+ cdef base16384_err_t ret
365
+ try:
366
+ with nogil:
367
+ ret = b14_encode_fd_detailed(inp, out, encbuf, decbuf, flag)
368
+ if ret != base16384_err_ok:
369
+ raise ValueError(err_to_str(ret))
370
+ finally:
371
+ PyMem_Free(encbuf)
372
+ PyMem_Free(decbuf)
373
+
374
+ cpdef inline decode_fd_detailed(int inp, int out, int flag):
375
+ cdef char * encbuf = <char *> PyMem_Malloc(<size_t>BASE16384_ENCBUFSZ)
376
+ if encbuf == NULL:
377
+ raise MemoryError
378
+ cdef char * decbuf = <char *> PyMem_Malloc(<size_t>BASE16384_DECBUFSZ)
379
+ if decbuf == NULL:
380
+ PyMem_Free(encbuf)
381
+ raise MemoryError
382
+ cdef base16384_err_t ret
383
+ try:
384
+ with nogil:
385
+ ret = b14_decode_fd_detailed(inp, out, encbuf, decbuf, flag)
386
+ if ret != base16384_err_ok:
387
+ raise ValueError(err_to_str(ret))
388
+ finally:
389
+ PyMem_Free(encbuf)
390
+ PyMem_Free(decbuf)
@@ -7,6 +7,11 @@ from libc.stdio cimport FILE
7
7
  cdef extern from "base16384.h" nogil:
8
8
  int BASE16384_ENCBUFSZ
9
9
  int BASE16384_DECBUFSZ
10
+
11
+ int BASE16384_FLAG_NOHEADER
12
+ int BASE16384_FLAG_SUM_CHECK_ON_REMAIN
13
+ int BASE16384_SIMPLE_SUM_INIT_VALUE
14
+
10
15
  ctypedef enum base16384_err_t:
11
16
  base16384_err_ok
12
17
  base16384_err_get_file_size
@@ -15,6 +20,10 @@ cdef extern from "base16384.h" nogil:
15
20
  base16384_err_write_file
16
21
  base16384_err_open_input_file
17
22
  base16384_err_map_input_file
23
+ base16384_err_read_file
24
+ base16384_err_invalid_file_name
25
+ base16384_err_invalid_commandline_parameter
26
+ base16384_err_invalid_decoding_checksum
18
27
  # encode_len calc min buf size to fill encode result
19
28
  int b14_encode_len "base16384_encode_len" (int dlen)
20
29
  # decode_len calc min buf size to fill decode result
@@ -22,9 +31,13 @@ cdef extern from "base16384.h" nogil:
22
31
 
23
32
  # encode data and write result into buf
24
33
  int b14_encode "base16384_encode" (const char* data, int dlen, char* buf)
34
+
35
+ int b14_encode_unsafe "base16384_encode_unsafe" (const char * data, int dlen, char * buf)
25
36
  # decode data and write result into buf
26
37
  int b14_decode "base16384_decode" (const char* data, int dlen, char* buf)
27
38
 
39
+ int b14_decode_unsafe "base16384_decode_unsafe"(const char * data, int dlen, char * buf)
40
+
28
41
  base16384_err_t b14_encode_file "base16384_encode_file" (const char * input, const char * output, char * encbuf, char * decbuf)
29
42
  base16384_err_t b14_decode_file "base16384_decode_file" (const char * input, const char * output, char * encbuf, char * decbuf)
30
43
 
@@ -43,6 +56,34 @@ cdef extern from "base16384.h" nogil:
43
56
  # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
44
57
  base16384_err_t b14_decode_fd "base16384_decode_fd"(int input, int output, char* encbuf, char* decbuf)
45
58
 
59
+ # detailed
60
+ # base16384_encode_file_detailed encodes input file to output file.
61
+ # use `-` to specify stdin/stdout
62
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
63
+ base16384_err_t b14_encode_file_detailed "base16384_encode_file_detailed" (const char* input, const char* output, char* encbuf, char* decbuf, int flag)
64
+
65
+ # base16384_encode_fp_detailed encodes input file to output file.
66
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
67
+ base16384_err_t b14_encode_fp_detailed "base16384_encode_fp_detailed" (FILE* input, FILE* output, char* encbuf, char* decbuf, int flag)
68
+
69
+ # base16384_encode_fd_detailed encodes input fd to output fd.
70
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
71
+ base16384_err_t b14_encode_fd_detailed "base16384_encode_fd_detailed" (int input, int output, char* encbuf, char* decbuf, int flag)
72
+
73
+ # base16384_decode_file_detailed decodes input file to output file.
74
+ # use `-` to specify stdin/stdout
75
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
76
+ base16384_err_t b14_decode_file_detailed "base16384_decode_file_detailed" (const char* input, const char* output, char* encbuf, char* decbuf, int flag)
77
+
78
+ # base16384_decode_fp_detailed decodes input file to output file.
79
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
80
+ base16384_err_t b14_decode_fp_detailed "base16384_decode_fp_detailed" (FILE* input, FILE* output, char* encbuf, char* decbuf, int flag)
81
+
82
+ # base16384_decode_fd_detailed decodes input fd to output fd.
83
+ # encbuf & decbuf must be no less than BASE16384_ENCBUFSZ & BASE16384_DECBUFSZ
84
+ base16384_err_t b14_decode_fd_detailed "base16384_decode_fd_detailed" (int input, int output, char* encbuf, char* decbuf, int flag)
85
+
86
+
46
87
  cdef extern from * nogil:
47
88
  """
48
89
  #ifdef CPUBIT32
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybase16384
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: fast base16384 encode and decode
5
5
  Home-page: https://github.com/synodriver/pybase16384
6
6
  Author: synodriver
@@ -0,0 +1,16 @@
1
+ pybase16384/__init__.py,sha256=7GvQhJQVZAIGGSmUlq3LmdyQO3LInUlnha4Yeqbq8W8,2933
2
+ pybase16384/backends/__init__.py,sha256=vdW_t1O2WNfdRmxDlEXRvTpyJj5ufKWAUsD2fbtku5g,55
3
+ pybase16384/backends/cffi/__init__.py,sha256=CsRpcA_dhOqkPm0Cn9Wh_RxAeba5RYhyDDPQoV3BHX8,9507
4
+ pybase16384/backends/cffi/build.py,sha256=d4Z9l6EF1yPwex5HmiMdQ-ANSHNtLeAiM3ksRnOZaas,4396
5
+ pybase16384/backends/cffi/_core.abi3.so,sha256=7uv3a22ijj3Gzw3Cg5DECODjdZwf3iXUybOIfqZRkYc,51992
6
+ pybase16384/backends/cython/_core.pyx,sha256=SlurBrEjfMkNit0kVDIJiATIJoGNRN5SPpb2v1g8NBM,15375
7
+ pybase16384/backends/cython/__init__.py,sha256=iBis69sFYOO94e7CLK9V1SkjtYJZMTHGmGWYgOq6Fdk,551
8
+ pybase16384/backends/cython/_core.pxi,sha256=2fXuRiumLqxO0bnmZVEz0lr_GX-grJGBfhGIVedfyt8,530
9
+ pybase16384/backends/cython/_core.c,sha256=cff5JrgaMyjEUXJxRpJht6-1TVNWMNy5DP_NqsYb3eA,1393171
10
+ pybase16384/backends/cython/base16384.pxd,sha256=ilQqiUp3FYxuibR_WTgAI079Q7FvAHCWWzW5fKBools,4654
11
+ pybase16384/backends/cython/_core.abi3.so,sha256=_dKJfTHhIkMx4T8pSXVuROtbaLC7xEk_OI9Z6ZIu5lM,277336
12
+ pybase16384-0.3.6.dist-info/RECORD,,
13
+ pybase16384-0.3.6.dist-info/METADATA,sha256=zbILm2cNiP-92qdQYVkyEfnizFKsacpRVE9D8ztiWKQ,5385
14
+ pybase16384-0.3.6.dist-info/WHEEL,sha256=gR9TjkNYfkpy4nQRxQmAidZL__i6l3gqCH5dmuKQe3Q,114
15
+ pybase16384-0.3.6.dist-info/top_level.txt,sha256=kXpl7pWjnjpm74qJP0SJg3JhbiWuwKQApJgkJH0B5Mk,12
16
+ pybase16384-0.3.6.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
@@ -1,16 +0,0 @@
1
- pybase16384/__init__.py,sha256=rQAzw1fl_zGoAZ7Y_xzcLZJZ908H9aRXT1BXnMnbu50,2429
2
- pybase16384/backends/__init__.py,sha256=vdW_t1O2WNfdRmxDlEXRvTpyJj5ufKWAUsD2fbtku5g,55
3
- pybase16384/backends/cffi/__init__.py,sha256=RB3eV5PG7rDGj_qPfHio4T9hWvAbw_SOuN7H8bPMxMU,7386
4
- pybase16384/backends/cffi/build.py,sha256=0lSU8r__QlNrdl3spvwlzzIqnZBcFXJylNZP6tkWEZU,2988
5
- pybase16384/backends/cffi/_core.abi3.so,sha256=HwSE2Py-Er0_9BkCuK6BH8XlurAMxi9Q7n2BDBAFYwA,33616
6
- pybase16384/backends/cython/_core.pyx,sha256=9ms8ao_KNaiJVqYxKSiF9W16IOdSwZUNu9ZX5CFFT1E,11482
7
- pybase16384/backends/cython/__init__.py,sha256=04-hw42BzdNPAKj9N8ZCgFLqw3GALZ8AsYmeyeneyzo,335
8
- pybase16384/backends/cython/_core.pxi,sha256=2fXuRiumLqxO0bnmZVEz0lr_GX-grJGBfhGIVedfyt8,530
9
- pybase16384/backends/cython/_core.c,sha256=ymzvWpW7yvCgutweFANtVEk7WEUHNROsb7uMpV9xXkU,1296337
10
- pybase16384/backends/cython/base16384.pxd,sha256=CpYE_Vav4l1n8fAzp0VRr0kEj8JYcQmpTa5-6wpfMHE,2272
11
- pybase16384/backends/cython/_core.abi3.so,sha256=cd3Oyos_QGEjRjia72xhUIitO4wtvSuIab7RUXV9gI8,258688
12
- pybase16384-0.3.5.dist-info/RECORD,,
13
- pybase16384-0.3.5.dist-info/METADATA,sha256=jHxwK4c-TH2No2_KE3gnACipKY2psSOPPhUDpl3EndM,5385
14
- pybase16384-0.3.5.dist-info/WHEEL,sha256=gR9TjkNYfkpy4nQRxQmAidZL__i6l3gqCH5dmuKQe3Q,114
15
- pybase16384-0.3.5.dist-info/top_level.txt,sha256=kXpl7pWjnjpm74qJP0SJg3JhbiWuwKQApJgkJH0B5Mk,12
16
- pybase16384-0.3.5.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148