pybase16384 0.3.3__cp310-cp310-win_amd64.whl → 0.3.5__cp310-cp310-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.

pybase16384/__init__.py CHANGED
@@ -48,7 +48,7 @@ else:
48
48
  is_64bits,
49
49
  )
50
50
 
51
- __version__ = "0.3.3"
51
+ __version__ = "0.3.5"
52
52
 
53
53
 
54
54
  def encode(data: bytes) -> bytes:
@@ -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._core_cffi import ffi, lib
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, output_size)
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), len(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, output_size)
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), len(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, output_size
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, output_size
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, int blen);
50
- int base16384_decode(const char* data, int dlen, char* buf, int blen);
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._core_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"],
@@ -1,7 +1,7 @@
1
1
  """
2
2
  Copyright (c) 2008-2021 synodriver <synodriver@gmail.com>
3
3
  """
4
- from pybase16384.backends.cython._core_cy import (
4
+ from pybase16384.backends.cython._core import (
5
5
  _decode,
6
6
  _decode_into,
7
7
  _encode,