virtuals-binary-codec 0.1.0__cp313-cp313-macosx_11_0_arm64.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.
@@ -0,0 +1,15 @@
1
+ """Cython-optimized binary key codec for Virtuals."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .binary_codec import BinaryKeyCodec
6
+ from .exceptions import DecodeError, EncodeError, IntegerOverflowError, KeyCodecError
7
+
8
+
9
+ __all__ = [
10
+ "BinaryKeyCodec",
11
+ "DecodeError",
12
+ "EncodeError",
13
+ "IntegerOverflowError",
14
+ "KeyCodecError",
15
+ ]
@@ -0,0 +1,14 @@
1
+ """Type stubs for binary_codec Cython extension."""
2
+
3
+ __all__ = ["BinaryKeyCodec"]
4
+
5
+ class BinaryKeyCodec:
6
+ """Binary key codec that preserves lexicographic ordering."""
7
+
8
+ def encode(self, key: tuple[str | int, ...]) -> bytes:
9
+ """Encode tuple key into binary format preserving lexicographic order."""
10
+ ...
11
+
12
+ def decode(self, encoded: bytes) -> tuple[str | int, ...]:
13
+ """Decode binary data back to original tuple key."""
14
+ ...
@@ -0,0 +1,344 @@
1
+ # cython: language_level=3
2
+ # cython: boundscheck=False
3
+ # cython: wraparound=False
4
+ # cython: cdivision=True
5
+ # cython: initializedcheck=False
6
+ # cython: nonecheck=False
7
+ # cython: overflowcheck=False
8
+ """Optimized Cython implementation of binary key codec."""
9
+
10
+ from libc.stdint cimport int64_t, uint64_t, INT64_MIN, INT64_MAX
11
+ from libc.string cimport memcpy
12
+ from cpython.bytes cimport PyBytes_FromStringAndSize, PyBytes_AS_STRING, PyBytes_GET_SIZE
13
+ from cpython.unicode cimport PyUnicode_AsUTF8String, PyUnicode_DecodeUTF8
14
+
15
+ from .exceptions import (
16
+ IntegerOverflowError,
17
+ EncodeError,
18
+ DecodeError,
19
+ )
20
+
21
+ # Type markers for lexicographic ordering (int < str)
22
+ cdef unsigned char TYPE_INT = 0x01
23
+ cdef unsigned char TYPE_STR = 0x02
24
+
25
+ # Component terminator - using null byte (0x00) to ensure shorter strings sort before
26
+ # longer strings with the same prefix. This is critical for lexicographic ordering.
27
+ cdef unsigned char TERMINATOR = 0x00
28
+
29
+ # Escape byte for null bytes within string content
30
+ # String encoding: \x00 in content -> \x00\xff (escaped), terminator is bare \x00
31
+ cdef unsigned char ESCAPE_BYTE = 0xFF
32
+
33
+ # Integer range constants
34
+ cdef int64_t INT64_MIN_VAL = INT64_MIN
35
+ cdef int64_t INT64_MAX_VAL = INT64_MAX
36
+ cdef uint64_t INT64_BIAS = 0x8000000000000000ULL # 2^63
37
+
38
+ # String constraints
39
+ cdef size_t MAX_STRING_LENGTH = 10 * 1024 * 1024 # 10MB
40
+
41
+
42
+ cdef inline void encode_integer_inline(int64_t value, unsigned char* buffer) noexcept nogil:
43
+ """Encode integer using bias/offset encoding directly into buffer.
44
+
45
+ Args:
46
+ value: Integer to encode (must be in int64 range)
47
+ buffer: Output buffer (must have at least 8 bytes available)
48
+ """
49
+ cdef uint64_t biased_value = <uint64_t>(value + <int64_t>INT64_BIAS)
50
+
51
+ # Write as big-endian (most significant byte first)
52
+ buffer[0] = <unsigned char>((biased_value >> 56) & 0xFF)
53
+ buffer[1] = <unsigned char>((biased_value >> 48) & 0xFF)
54
+ buffer[2] = <unsigned char>((biased_value >> 40) & 0xFF)
55
+ buffer[3] = <unsigned char>((biased_value >> 32) & 0xFF)
56
+ buffer[4] = <unsigned char>((biased_value >> 24) & 0xFF)
57
+ buffer[5] = <unsigned char>((biased_value >> 16) & 0xFF)
58
+ buffer[6] = <unsigned char>((biased_value >> 8) & 0xFF)
59
+ buffer[7] = <unsigned char>(biased_value & 0xFF)
60
+
61
+
62
+ cdef inline int64_t decode_integer_inline(const unsigned char* buffer) noexcept nogil:
63
+ """Decode integer from buffer using bias/offset encoding.
64
+
65
+ Args:
66
+ buffer: Input buffer (must have at least 8 bytes)
67
+
68
+ Returns:
69
+ Decoded integer value
70
+ """
71
+ cdef uint64_t biased_value = (
72
+ (<uint64_t>buffer[0] << 56) |
73
+ (<uint64_t>buffer[1] << 48) |
74
+ (<uint64_t>buffer[2] << 40) |
75
+ (<uint64_t>buffer[3] << 32) |
76
+ (<uint64_t>buffer[4] << 24) |
77
+ (<uint64_t>buffer[5] << 16) |
78
+ (<uint64_t>buffer[6] << 8) |
79
+ <uint64_t>buffer[7]
80
+ )
81
+
82
+ # Remove bias to get original signed value
83
+ return <int64_t>(biased_value - INT64_BIAS)
84
+
85
+
86
+ cdef inline Py_ssize_t count_null_bytes(const unsigned char* data, Py_ssize_t length) noexcept nogil:
87
+ """Count null bytes in data for calculating escaped size."""
88
+ cdef Py_ssize_t count = 0
89
+ cdef Py_ssize_t i
90
+ for i in range(length):
91
+ if data[i] == 0x00:
92
+ count += 1
93
+ return count
94
+
95
+
96
+ cdef inline Py_ssize_t copy_with_escape(unsigned char* dest, const unsigned char* src, Py_ssize_t length) noexcept nogil:
97
+ r"""Copy source to dest, escaping null bytes (\x00 -> \x00\xff).
98
+
99
+ Returns the number of bytes written to dest.
100
+ """
101
+ cdef Py_ssize_t dest_pos = 0
102
+ cdef Py_ssize_t i
103
+ for i in range(length):
104
+ dest[dest_pos] = src[i]
105
+ dest_pos += 1
106
+ if src[i] == 0x00:
107
+ dest[dest_pos] = ESCAPE_BYTE
108
+ dest_pos += 1
109
+ return dest_pos
110
+
111
+
112
+ cdef class BinaryKeyCodec:
113
+ """Optimized binary key codec that preserves lexicographic ordering.
114
+
115
+ This Cython implementation provides maximum performance for encoding and
116
+ decoding tuple keys into binary format while maintaining sort order.
117
+
118
+ Features:
119
+ - Zero Python overhead in hot paths
120
+ - Direct memory operations
121
+ - Inline integer encoding/decoding
122
+ - Efficient buffer management
123
+ - Preserves lexicographic ordering
124
+ - Uses null byte (0x00) terminator with escaping for correct string ordering
125
+
126
+ Encoding format:
127
+ - Each component: TYPE_MARKER + ENCODED_VALUE + TERMINATOR
128
+ - Integers: TYPE_INT (0x01) + 8_BYTES + TERMINATOR (0x00)
129
+ - Strings: TYPE_STR (0x02) + ESCAPED_UTF8_BYTES + TERMINATOR (0x00)
130
+
131
+ String escaping:
132
+ - Null bytes in content: 0x00 -> 0x00 0xFF (escaped)
133
+ - Terminator is bare 0x00 (not escaped)
134
+ - This ensures shorter strings sort before longer strings with same prefix
135
+ """
136
+
137
+ def encode(self, tuple key):
138
+ """Encode tuple key into binary format preserving lexicographic order.
139
+
140
+ Args:
141
+ key: Tuple containing strings and/or integers
142
+
143
+ Returns:
144
+ Binary encoded key (bytes)
145
+
146
+ Raises:
147
+ IntegerOverflowError: If integer is outside int64 range
148
+ EncodeError: If encoding fails
149
+ """
150
+ if not key:
151
+ raise EncodeError("Empty tuple not allowed as key")
152
+
153
+ cdef Py_ssize_t num_components = len(key)
154
+ cdef Py_ssize_t i
155
+ cdef object component
156
+ cdef int64_t int_val
157
+ cdef bytes str_bytes
158
+ cdef const unsigned char* str_data
159
+ cdef Py_ssize_t str_len
160
+ cdef Py_ssize_t null_count
161
+
162
+ # First pass: calculate exact size (accounting for null byte escaping)
163
+ cdef Py_ssize_t total_size = 0
164
+ for i in range(num_components):
165
+ component = key[i]
166
+
167
+ if isinstance(component, int):
168
+ # Check bounds
169
+ try:
170
+ int_val = <int64_t>component
171
+ except OverflowError:
172
+ raise IntegerOverflowError(component)
173
+
174
+ if int_val < INT64_MIN_VAL or int_val > INT64_MAX_VAL:
175
+ raise IntegerOverflowError(int_val, INT64_MIN_VAL, INT64_MAX_VAL)
176
+ total_size += 1 + 8 + 1 # type + 8 bytes + terminator
177
+
178
+ elif isinstance(component, str):
179
+ str_bytes = PyUnicode_AsUTF8String(component)
180
+ str_data = <const unsigned char*>PyBytes_AS_STRING(str_bytes)
181
+ str_len = PyBytes_GET_SIZE(str_bytes)
182
+
183
+ # Check string length bounds
184
+ if str_len == 0:
185
+ raise EncodeError(f"Empty string at index {i} not allowed")
186
+ if str_len > MAX_STRING_LENGTH:
187
+ raise EncodeError(
188
+ f"String at index {i} too long: {str_len} bytes "
189
+ f"(max {MAX_STRING_LENGTH})"
190
+ )
191
+
192
+ # Count null bytes for escape sizing
193
+ null_count = count_null_bytes(str_data, str_len)
194
+ # type + utf8 bytes + escape bytes for nulls + terminator
195
+ total_size += 1 + str_len + null_count + 1
196
+ else:
197
+ raise EncodeError(
198
+ f"Component at index {i} must be str or int, "
199
+ f"got {type(component).__name__}"
200
+ )
201
+
202
+ # Allocate output buffer
203
+ cdef bytes result = PyBytes_FromStringAndSize(NULL, total_size)
204
+ cdef unsigned char* buffer = <unsigned char*>PyBytes_AS_STRING(result)
205
+ cdef Py_ssize_t pos = 0
206
+
207
+ # Second pass: encode into buffer
208
+ for i in range(num_components):
209
+ component = key[i]
210
+
211
+ if isinstance(component, int):
212
+ int_val = <int64_t>component
213
+
214
+ # Write type marker
215
+ buffer[pos] = TYPE_INT
216
+ pos += 1
217
+
218
+ # Encode integer
219
+ encode_integer_inline(int_val, &buffer[pos])
220
+ pos += 8
221
+
222
+ # Write terminator
223
+ buffer[pos] = TERMINATOR
224
+ pos += 1
225
+
226
+ else: # isinstance(component, str)
227
+ str_bytes = PyUnicode_AsUTF8String(component)
228
+ str_data = <const unsigned char*>PyBytes_AS_STRING(str_bytes)
229
+ str_len = PyBytes_GET_SIZE(str_bytes)
230
+
231
+ # Write type marker
232
+ buffer[pos] = TYPE_STR
233
+ pos += 1
234
+
235
+ # Copy string bytes with null byte escaping
236
+ pos += copy_with_escape(&buffer[pos], str_data, str_len)
237
+
238
+ # Write terminator
239
+ buffer[pos] = TERMINATOR
240
+ pos += 1
241
+
242
+ return result
243
+
244
+ def decode(self, bytes encoded):
245
+ """Decode binary data back to original tuple key.
246
+
247
+ Args:
248
+ encoded: Previously encoded binary key
249
+
250
+ Returns:
251
+ Original tuple key
252
+
253
+ Raises:
254
+ DecodeError: If data is invalid or corrupted
255
+ """
256
+ if not encoded:
257
+ raise DecodeError("Empty encoded key")
258
+
259
+ cdef const unsigned char* data = <const unsigned char*>PyBytes_AS_STRING(encoded)
260
+ cdef Py_ssize_t data_len = PyBytes_GET_SIZE(encoded)
261
+ cdef Py_ssize_t pos = 0
262
+
263
+ cdef list result = []
264
+ cdef unsigned char type_marker
265
+ cdef int64_t int_val
266
+ cdef Py_ssize_t str_start, str_end
267
+ cdef bytes str_bytes
268
+ cdef str decoded_str
269
+
270
+ while pos < data_len:
271
+ # Read type marker
272
+ if pos >= data_len:
273
+ raise DecodeError("Unexpected end of data while reading type marker")
274
+
275
+ type_marker = data[pos]
276
+ pos += 1
277
+
278
+ if type_marker == TYPE_INT:
279
+ # Check we have enough bytes for integer
280
+ if pos + 8 > data_len:
281
+ raise DecodeError(
282
+ f"Insufficient bytes for integer at offset {pos - 1}"
283
+ )
284
+
285
+ # Decode integer
286
+ int_val = decode_integer_inline(&data[pos])
287
+ result.append(int_val)
288
+ pos += 8
289
+
290
+ # Check terminator
291
+ if pos >= data_len or data[pos] != TERMINATOR:
292
+ raise DecodeError(
293
+ f"Missing terminator after integer at position {pos}"
294
+ )
295
+ pos += 1
296
+
297
+ elif type_marker == TYPE_STR:
298
+ # Find next UNESCAPED terminator (bare \x00, not \x00\xff)
299
+ str_start = pos
300
+ str_end = -1
301
+
302
+ while pos < data_len:
303
+ if data[pos] == TERMINATOR:
304
+ # Check if this is an escaped null (\x00\xff) or real terminator
305
+ if pos + 1 < data_len and data[pos + 1] == ESCAPE_BYTE:
306
+ # This is an escaped null byte, skip both bytes
307
+ pos += 2
308
+ else:
309
+ # This is the real terminator
310
+ str_end = pos
311
+ break
312
+ else:
313
+ pos += 1
314
+
315
+ if str_end == -1:
316
+ raise DecodeError(
317
+ f"Missing terminator after string at position {str_start - 1}"
318
+ )
319
+
320
+ # Get escaped string bytes and unescape them
321
+ str_bytes = encoded[str_start:str_end]
322
+ # Unescape: \x00\xff -> \x00
323
+ str_bytes = str_bytes.replace(b"\x00\xff", b"\x00")
324
+ try:
325
+ decoded_str = PyUnicode_DecodeUTF8(
326
+ PyBytes_AS_STRING(str_bytes),
327
+ PyBytes_GET_SIZE(str_bytes),
328
+ NULL # Use default error handling (strict)
329
+ )
330
+ result.append(decoded_str)
331
+ except UnicodeDecodeError as e:
332
+ raise DecodeError(f"Invalid UTF-8 in encoded string: {e}")
333
+
334
+ pos = str_end + 1
335
+
336
+ else:
337
+ raise DecodeError(
338
+ f"Invalid type marker at position {pos - 1}: 0x{type_marker:02x}"
339
+ )
340
+
341
+ return tuple(result)
342
+
343
+
344
+ __all__ = ['BinaryKeyCodec']
@@ -0,0 +1,50 @@
1
+ """Exception classes for binary key codec."""
2
+
3
+ from __future__ import annotations
4
+
5
+
6
+ __all__ = [
7
+ "DecodeError",
8
+ "EncodeError",
9
+ "IntegerOverflowError",
10
+ "KeyCodecError",
11
+ ]
12
+
13
+
14
+ class KeyCodecError(Exception):
15
+ """Base exception for all key codec errors."""
16
+
17
+ pass
18
+
19
+
20
+ class EncodeError(KeyCodecError):
21
+ """Raised when encoding a key fails."""
22
+
23
+ pass
24
+
25
+
26
+ class DecodeError(KeyCodecError):
27
+ """Raised when decoding an encoded key fails."""
28
+
29
+ pass
30
+
31
+
32
+ class IntegerOverflowError(EncodeError):
33
+ """Raised when an integer value exceeds the codec's supported range."""
34
+
35
+ def __init__( # noqa: D107
36
+ self,
37
+ value: int | None = None,
38
+ min_value: int | None = None,
39
+ max_value: int | None = None,
40
+ ) -> None:
41
+ if value is not None:
42
+ self.value = value
43
+ self.min_value = min_value
44
+ self.max_value = max_value
45
+ super().__init__(
46
+ f"Integer {value} out of supported range"
47
+ f"{f' [{min_value}, {max_value}]' if min_value is not None and max_value is not None else ''}"
48
+ )
49
+ else:
50
+ super().__init__("Integer value out of supported range")
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: virtuals-binary-codec
3
+ Version: 0.1.0
4
+ Summary: Cython-optimized binary key codec for Virtuals.
5
+ Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/nustackdev/virtuals
8
+ Project-URL: Repository, https://github.com/nustackdev/virtuals
9
+ Project-URL: Issues, https://github.com/nustackdev/virtuals/issues
10
+ Project-URL: PyPI, https://pypi.org/project/virtuals-binary-codec/
11
+ Keywords: virtuals,codec,binary,cython,key-value
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: Implementation :: CPython
22
+ Classifier: Programming Language :: Cython
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: dev
28
+ Requires-Dist: Cython>=3.0.0; extra == "dev"
29
+ Requires-Dist: setuptools>=68.0; extra == "dev"
30
+ Provides-Extra: test
31
+ Requires-Dist: pytest>=7.0.0; extra == "test"
32
+ Dynamic: license-file
33
+
34
+ # virtuals-binary-codec
35
+
36
+ Cython-optimized binary key codec for [Virtuals](https://github.com/nustackdev/virtuals).
37
+
38
+ Encodes tuple keys into binary format while preserving lexicographic ordering. Supports mixed integer and string components.
39
+
40
+ ## Install
41
+
42
+ ```
43
+ pip install virtuals-binary-codec
44
+ ```
45
+
46
+ Or as part of Virtuals:
47
+
48
+ ```
49
+ pip install virtuals-py[binary]
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ```python
55
+ from virtuals_binary_codec import BinaryKeyCodec
56
+
57
+ codec = BinaryKeyCodec()
58
+ encoded = codec.encode(("users", 42, "profile"))
59
+ decoded = codec.decode(encoded)
60
+ assert decoded == ("users", 42, "profile")
61
+ ```
62
+
63
+ Virtuals automatically uses this codec when installed. Without it, Virtuals falls back to a pure Python implementation.
@@ -0,0 +1,10 @@
1
+ virtuals_binary_codec-0.1.0.dist-info/RECORD,,
2
+ virtuals_binary_codec-0.1.0.dist-info/WHEEL,sha256=I7C6oPU9_YXUwpeWU-HCMP--1MGENZx31r2O4ozCW_U,136
3
+ virtuals_binary_codec-0.1.0.dist-info/top_level.txt,sha256=iKCXgp2qhJDwjutPb0DsG3nRmQjVzlXenDeG0R4sVvw,22
4
+ virtuals_binary_codec-0.1.0.dist-info/METADATA,sha256=l-0y9VYPxJs3lFkXEHjQE-NG4mz6bLoGEm8T_kAQHBQ,2133
5
+ virtuals_binary_codec-0.1.0.dist-info/licenses/LICENSE,sha256=aJSBYDIiIbyXAthmOf9iaKLLG70zXk_BfpY3y4BTYxM,11285
6
+ virtuals_binary_codec/binary_codec.pyi,sha256=uPwpKDrrZ8LAm_WXzv4T6mj895nY6SErH8Zxj3qyNQQ,462
7
+ virtuals_binary_codec/binary_codec.cpython-313-darwin.so,sha256=Z25ra9EY49mNkJWf4G7_AnaDQ55hq-H0Vu1gBwCLGg0,133776
8
+ virtuals_binary_codec/__init__.py,sha256=lRGQMw_zANauir6RAPc1A8cvmt_YnPrQooBJPqu1aU8,343
9
+ virtuals_binary_codec/binary_codec.pyx,sha256=50c_dw-tzhh6cmA5EFa5dQvspiONMYcrJXO3QSByoXI,12159
10
+ virtuals_binary_codec/exceptions.py,sha256=1TQt0HoeWZIuJaTBgl8jSPaCDoQMynAMiSywpC0ba0k,1195
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
6
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Gor Arakelyan
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ virtuals_binary_codec