cchecksum 0.3.7.dev0__cp314-cp314-musllinux_1_2_i686.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,57 @@
1
+ from eth_typing import AnyAddress, ChecksumAddress, HexAddress
2
+ from typing import Union
3
+
4
+ def to_checksum_address(value: Union[AnyAddress, str, bytes]) -> ChecksumAddress:
5
+ """
6
+ Convert an address to its EIP-55 checksum format.
7
+
8
+ This function takes an address in any supported format and returns it in the
9
+ checksummed format as defined by EIP-55. It uses a custom Cython implementation
10
+ for the checksum conversion to optimize performance.
11
+
12
+ Args:
13
+ value: The address to be converted. It can be in any format supported by
14
+ :func:`eth_utils.to_normalized_address`.
15
+
16
+ Raises:
17
+ ValueError: If the input address is not in a recognized format.
18
+ TypeError: If the input is not a string, bytes, or any address type.
19
+
20
+ Examples:
21
+ >>> to_checksum_address("0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb")
22
+ '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
23
+
24
+ >>> to_checksum_address(b'\xb4~<\xd87\xdd\xf8\xe4\xc5\x7f\x05\xd7\n\xb8e\xden\x19;\xbb')
25
+ '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
26
+
27
+ See Also:
28
+ - :func:`eth_utils.to_checksum_address` for the standard implementation.
29
+ - :func:`to_normalized_address` for converting to a normalized address before checksumming.
30
+ """
31
+
32
+ def to_normalized_address_no_0x(value: Union[AnyAddress, str, bytes]) -> bytes:
33
+ """
34
+ Converts an address to its normalized hexadecimal representation without the '0x' prefix.
35
+
36
+ This function ensures that the address is in a consistent lowercase hexadecimal
37
+ format, which is useful for further processing or validation.
38
+
39
+ Args:
40
+ value: The address to be normalized.
41
+
42
+ Raises:
43
+ ValueError: If the input address is not in a recognized format.
44
+ TypeError: If the input is not a string, bytes, or any address type.
45
+
46
+ Examples:
47
+ >>> to_normalized_address("0xB47E3CD837DDF8E4C57F05D70AB865DE6E193BBB")
48
+ '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
49
+
50
+ >>> to_normalized_address(b'\xb4~<\xd87\xdd\xf8\xe4\xc5\x7f\x05\xd7\n\xb8e\xden\x19;\xbb')
51
+ '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
52
+
53
+ See Also:
54
+ - :func:`eth_utils.to_normalized_address` for the standard implementation.
55
+ """
56
+
57
+ def cchecksum(norm_address_no_0x: bytes, address_hash_hex_no_0x: bytes) -> ChecksumAddress: ...
@@ -0,0 +1,437 @@
1
+ # cython: boundscheck=False
2
+ # cython: wraparound=False
3
+
4
+ from cpython.bytes cimport PyBytes_GET_SIZE
5
+ from cpython.unicode cimport PyUnicode_AsEncodedString
6
+
7
+ from eth_hash.auto import keccak
8
+ from eth_typing import AnyAddress, ChecksumAddress
9
+
10
+
11
+ # force _hasher_first_run and _preimage_first_run to execute so we can cache the new hasher
12
+ keccak(b"")
13
+
14
+ cdef object hash_address = keccak.hasher
15
+ cdef const unsigned char* hexdigits = b"0123456789abcdef"
16
+
17
+
18
+ # this was ripped out of eth_utils and optimized a little bit
19
+
20
+
21
+ cpdef unicode to_checksum_address(value: Union[AnyAddress, str, bytes]):
22
+ """
23
+ Convert an address to its EIP-55 checksum format.
24
+
25
+ This function takes an address in any supported format and returns it in the
26
+ checksummed format as defined by EIP-55. It uses a custom Cython implementation
27
+ for the checksum conversion to optimize performance.
28
+
29
+ Args:
30
+ value: The address to be converted. It can be in any format supported by
31
+ :func:`eth_utils.to_normalized_address`.
32
+
33
+ Raises:
34
+ ValueError: If the input address is not in a recognized format.
35
+ TypeError: If the input is not a string, bytes, or any address type.
36
+
37
+ Examples:
38
+ >>> to_checksum_address("0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb")
39
+ '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
40
+
41
+ >>> to_checksum_address(b'\xb4~<\xd87\xdd\xf8\xe4\xc5\x7f\x05\xd7\n\xb8e\xden\x19;\xbb')
42
+ '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
43
+
44
+ See Also:
45
+ - :func:`eth_utils.to_checksum_address` for the standard implementation.
46
+ - :func:`to_normalized_address` for converting to a normalized address before checksumming.
47
+ """
48
+ cdef bytes hex_address_bytes, hashed_bytes
49
+ cdef const unsigned char* hex_address_bytestr
50
+ cdef unsigned char c
51
+
52
+ cdef unsigned char[:] hash_buffer = bytearray(80) # contiguous and writeable
53
+
54
+ # Create a buffer for our result
55
+ # 2 for "0x" prefix and 40 for the address itself
56
+ cdef char[42] result_buffer = b'0x' + bytearray(40)
57
+
58
+ if isinstance(value, str):
59
+ hex_address_bytes = lowercase_ascii_and_validate(PyUnicode_AsEncodedString(value, b"ascii", NULL))
60
+ hex_address_bytestr = hex_address_bytes
61
+
62
+ elif isinstance(value, (bytes, bytearray)):
63
+ hex_address_bytes = hexlify(value).lower()
64
+ hex_address_bytestr = hex_address_bytes
65
+ num_bytes = PyBytes_GET_SIZE(hex_address_bytes)
66
+
67
+ with nogil:
68
+ for i in range(num_bytes):
69
+ c = hex_address_bytestr[i]
70
+
71
+ if c == 48: # 0
72
+ pass
73
+ elif c == 49: # 1
74
+ pass
75
+ elif c == 50: # 2
76
+ pass
77
+ elif c == 51: # 3
78
+ pass
79
+ elif c == 52: # 4
80
+ pass
81
+ elif c == 53: # 5
82
+ pass
83
+ elif c == 54: # 6
84
+ pass
85
+ elif c == 55: # 7
86
+ pass
87
+ elif c == 56: # 8
88
+ pass
89
+ elif c == 57: # 9
90
+ pass
91
+ elif c == 97: # a
92
+ pass
93
+ elif c == 98: # b
94
+ pass
95
+ elif c == 99: # c
96
+ pass
97
+ elif c == 100: # d
98
+ pass
99
+ elif c == 101: # e
100
+ pass
101
+ elif c == 102: # f
102
+ pass
103
+ else:
104
+ raise ValueError(
105
+ f"Unknown format {repr(value)}, attempted to normalize to '0x{hex_address_bytes.decode()}'"
106
+ )
107
+
108
+ else:
109
+ raise TypeError(
110
+ f"Unsupported type: '{repr(type(value))}'. Must be one of: bool, str, bytes, bytearray or int."
111
+ )
112
+
113
+ if PyBytes_GET_SIZE(hex_address_bytes) != 40:
114
+ raise ValueError(
115
+ f"Unknown format {repr(value)}, attempted to normalize to '0x{hex_address_bytes.decode()}'"
116
+ )
117
+
118
+ hashed_bytes = hash_address(hex_address_bytes)
119
+ cdef const unsigned char* hashed_bytestr = hashed_bytes
120
+
121
+ with nogil:
122
+ hexlify_c_string_to_buffer(hashed_bytestr, hash_buffer, 40)
123
+ populate_result_buffer(result_buffer, hex_address_bytestr, hash_buffer)
124
+
125
+ # It is faster to decode a buffer with a known size ie buffer[:42]
126
+ return result_buffer[:42].decode('ascii')
127
+
128
+
129
+ cpdef bytes hexlify(const unsigned char[:] src_buffer):
130
+ return bytes(hexlify_unsafe(src_buffer, len(src_buffer)))
131
+
132
+
133
+ cdef const unsigned char[:] hexlify_unsafe(const unsigned char[:] src_buffer, Py_ssize_t num_bytes) noexcept:
134
+ """Make sure your `num_bytes` is correct or ting go boom"""
135
+ cdef unsigned char[:] result_buffer = bytearray(num_bytes * 2) # contiguous and writeable
136
+ with nogil:
137
+ hexlify_memview_to_buffer(src_buffer, result_buffer, num_bytes)
138
+ return result_buffer
139
+
140
+
141
+ cdef inline void hexlify_memview_to_buffer(
142
+ const unsigned char[:] src_buffer,
143
+ unsigned char[:] result_buffer,
144
+ Py_ssize_t num_bytes,
145
+ ) noexcept nogil:
146
+ cdef Py_ssize_t i
147
+ cdef unsigned char c
148
+ for i in range(num_bytes):
149
+ c = src_buffer[i]
150
+ result_buffer[2*i] = hexdigits[c >> 4]
151
+ result_buffer[2*i+1] = hexdigits[c & 0x0F]
152
+
153
+
154
+ cdef inline void hexlify_c_string_to_buffer(
155
+ const unsigned char* src_buffer,
156
+ unsigned char[:] result_buffer,
157
+ Py_ssize_t num_bytes,
158
+ ) noexcept nogil:
159
+ cdef Py_ssize_t i
160
+ cdef unsigned char c
161
+ for i in range(num_bytes):
162
+ c = src_buffer[i]
163
+ result_buffer[2*i] = hexdigits[c >> 4]
164
+ result_buffer[2*i+1] = hexdigits[c & 0x0F]
165
+
166
+
167
+ cdef void populate_result_buffer(
168
+ char[42] buffer,
169
+ const unsigned char* norm_address_no_0x,
170
+ const unsigned char[:] address_hash_hex_no_0x,
171
+ ) noexcept nogil:
172
+ """
173
+ Computes the checksummed version of an Ethereum address.
174
+
175
+ This function takes a normalized Ethereum address (without the '0x' prefix) and its corresponding
176
+ hash (also without the '0x' prefix) and returns the checksummed address as per the Ethereum
177
+ Improvement Proposal 55 (EIP-55).
178
+
179
+ Args:
180
+ norm_address_no_0x: The normalized Ethereum address without the '0x' prefix.
181
+ address_hash_hex_no_0x: The hash of the address, also without the '0x' prefix.
182
+
183
+ Returns:
184
+ The checksummed Ethereum address with the '0x' prefix.
185
+
186
+ See Also:
187
+ - :func:`eth_utils.to_checksum_address`: A utility function for converting addresses to their checksummed form.
188
+ """
189
+ # Handle character casing based on the hash value
190
+ # `if address_hash_hex_no_0x[x] < 56`
191
+ # '0' to '7' have ASCII values 48 to 55
192
+ if address_hash_hex_no_0x[0] < 56:
193
+ buffer[2] = norm_address_no_0x[0]
194
+ else:
195
+ buffer[2] = get_char(norm_address_no_0x[0])
196
+ if address_hash_hex_no_0x[1] < 56:
197
+ buffer[3] = norm_address_no_0x[1]
198
+ else:
199
+ buffer[3] = get_char(norm_address_no_0x[1])
200
+ if address_hash_hex_no_0x[2] < 56:
201
+ buffer[4] = norm_address_no_0x[2]
202
+ else:
203
+ buffer[4] = get_char(norm_address_no_0x[2])
204
+ if address_hash_hex_no_0x[3] < 56:
205
+ buffer[5] = norm_address_no_0x[3]
206
+ else:
207
+ buffer[5] = get_char(norm_address_no_0x[3])
208
+ if address_hash_hex_no_0x[4] < 56:
209
+ buffer[6] = norm_address_no_0x[4]
210
+ else:
211
+ buffer[6] = get_char(norm_address_no_0x[4])
212
+ if address_hash_hex_no_0x[5] < 56:
213
+ buffer[7] = norm_address_no_0x[5]
214
+ else:
215
+ buffer[7] = get_char(norm_address_no_0x[5])
216
+ if address_hash_hex_no_0x[6] < 56:
217
+ buffer[8] = norm_address_no_0x[6]
218
+ else:
219
+ buffer[8] = get_char(norm_address_no_0x[6])
220
+ if address_hash_hex_no_0x[7] < 56:
221
+ buffer[9] = norm_address_no_0x[7]
222
+ else:
223
+ buffer[9] = get_char(norm_address_no_0x[7])
224
+ if address_hash_hex_no_0x[8] < 56:
225
+ buffer[10] = norm_address_no_0x[8]
226
+ else:
227
+ buffer[10] = get_char(norm_address_no_0x[8])
228
+ if address_hash_hex_no_0x[9] < 56:
229
+ buffer[11] = norm_address_no_0x[9]
230
+ else:
231
+ buffer[11] = get_char(norm_address_no_0x[9])
232
+ if address_hash_hex_no_0x[10] < 56:
233
+ buffer[12] = norm_address_no_0x[10]
234
+ else:
235
+ buffer[12] = get_char(norm_address_no_0x[10])
236
+ if address_hash_hex_no_0x[11] < 56:
237
+ buffer[13] = norm_address_no_0x[11]
238
+ else:
239
+ buffer[13] = get_char(norm_address_no_0x[11])
240
+ if address_hash_hex_no_0x[12] < 56:
241
+ buffer[14] = norm_address_no_0x[12]
242
+ else:
243
+ buffer[14] = get_char(norm_address_no_0x[12])
244
+ if address_hash_hex_no_0x[13] < 56:
245
+ buffer[15] = norm_address_no_0x[13]
246
+ else:
247
+ buffer[15] = get_char(norm_address_no_0x[13])
248
+ if address_hash_hex_no_0x[14] < 56:
249
+ buffer[16] = norm_address_no_0x[14]
250
+ else:
251
+ buffer[16] = get_char(norm_address_no_0x[14])
252
+ if address_hash_hex_no_0x[15] < 56:
253
+ buffer[17] = norm_address_no_0x[15]
254
+ else:
255
+ buffer[17] = get_char(norm_address_no_0x[15])
256
+ if address_hash_hex_no_0x[16] < 56:
257
+ buffer[18] = norm_address_no_0x[16]
258
+ else:
259
+ buffer[18] = get_char(norm_address_no_0x[16])
260
+ if address_hash_hex_no_0x[17] < 56:
261
+ buffer[19] = norm_address_no_0x[17]
262
+ else:
263
+ buffer[19] = get_char(norm_address_no_0x[17])
264
+ if address_hash_hex_no_0x[18] < 56:
265
+ buffer[20] = norm_address_no_0x[18]
266
+ else:
267
+ buffer[20] = get_char(norm_address_no_0x[18])
268
+ if address_hash_hex_no_0x[19] < 56:
269
+ buffer[21] = norm_address_no_0x[19]
270
+ else:
271
+ buffer[21] = get_char(norm_address_no_0x[19])
272
+ if address_hash_hex_no_0x[20] < 56:
273
+ buffer[22] = norm_address_no_0x[20]
274
+ else:
275
+ buffer[22] = get_char(norm_address_no_0x[20])
276
+ if address_hash_hex_no_0x[21] < 56:
277
+ buffer[23] = norm_address_no_0x[21]
278
+ else:
279
+ buffer[23] = get_char(norm_address_no_0x[21])
280
+ if address_hash_hex_no_0x[22] < 56:
281
+ buffer[24] = norm_address_no_0x[22]
282
+ else:
283
+ buffer[24] = get_char(norm_address_no_0x[22])
284
+ if address_hash_hex_no_0x[23] < 56:
285
+ buffer[25] = norm_address_no_0x[23]
286
+ else:
287
+ buffer[25] = get_char(norm_address_no_0x[23])
288
+ if address_hash_hex_no_0x[24] < 56:
289
+ buffer[26] = norm_address_no_0x[24]
290
+ else:
291
+ buffer[26] = get_char(norm_address_no_0x[24])
292
+ if address_hash_hex_no_0x[25] < 56:
293
+ buffer[27] = norm_address_no_0x[25]
294
+ else:
295
+ buffer[27] = get_char(norm_address_no_0x[25])
296
+ if address_hash_hex_no_0x[26] < 56:
297
+ buffer[28] = norm_address_no_0x[26]
298
+ else:
299
+ buffer[28] = get_char(norm_address_no_0x[26])
300
+ if address_hash_hex_no_0x[27] < 56:
301
+ buffer[29] = norm_address_no_0x[27]
302
+ else:
303
+ buffer[29] = get_char(norm_address_no_0x[27])
304
+ if address_hash_hex_no_0x[28] < 56:
305
+ buffer[30] = norm_address_no_0x[28]
306
+ else:
307
+ buffer[30] = get_char(norm_address_no_0x[28])
308
+ if address_hash_hex_no_0x[29] < 56:
309
+ buffer[31] = norm_address_no_0x[29]
310
+ else:
311
+ buffer[31] = get_char(norm_address_no_0x[29])
312
+ if address_hash_hex_no_0x[30] < 56:
313
+ buffer[32] = norm_address_no_0x[30]
314
+ else:
315
+ buffer[32] = get_char(norm_address_no_0x[30])
316
+ if address_hash_hex_no_0x[31] < 56:
317
+ buffer[33] = norm_address_no_0x[31]
318
+ else:
319
+ buffer[33] = get_char(norm_address_no_0x[31])
320
+ if address_hash_hex_no_0x[32] < 56:
321
+ buffer[34] = norm_address_no_0x[32]
322
+ else:
323
+ buffer[34] = get_char(norm_address_no_0x[32])
324
+ if address_hash_hex_no_0x[33] < 56:
325
+ buffer[35] = norm_address_no_0x[33]
326
+ else:
327
+ buffer[35] = get_char(norm_address_no_0x[33])
328
+ if address_hash_hex_no_0x[34] < 56:
329
+ buffer[36] = norm_address_no_0x[34]
330
+ else:
331
+ buffer[36] = get_char(norm_address_no_0x[34])
332
+ if address_hash_hex_no_0x[35] < 56:
333
+ buffer[37] = norm_address_no_0x[35]
334
+ else:
335
+ buffer[37] = get_char(norm_address_no_0x[35])
336
+ if address_hash_hex_no_0x[36] < 56:
337
+ buffer[38] = norm_address_no_0x[36]
338
+ else:
339
+ buffer[38] = get_char(norm_address_no_0x[36])
340
+ if address_hash_hex_no_0x[37] < 56:
341
+ buffer[39] = norm_address_no_0x[37]
342
+ else:
343
+ buffer[39] = get_char(norm_address_no_0x[37])
344
+ if address_hash_hex_no_0x[38] < 56:
345
+ buffer[40] = norm_address_no_0x[38]
346
+ else:
347
+ buffer[40] = get_char(norm_address_no_0x[38])
348
+ if address_hash_hex_no_0x[39] < 56:
349
+ buffer[41] = norm_address_no_0x[39]
350
+ else:
351
+ buffer[41] = get_char(norm_address_no_0x[39])
352
+
353
+
354
+ cdef inline unsigned char get_char(unsigned char c) noexcept nogil:
355
+ """This checks if `address_char` falls in the ASCII range for lowercase hexadecimal
356
+ characters ('a' to 'f'), which correspond to ASCII values 97 to 102. If it does,
357
+ the character is capitalized.
358
+ """
359
+ if c == 97: # a
360
+ return 65 # A
361
+ elif c == 98: # b
362
+ return 66 # B
363
+ elif c == 99: # c
364
+ return 67 # C
365
+ elif c == 100: # d
366
+ return 68 # D
367
+ elif c == 101: # e
368
+ return 69 # E
369
+ elif c == 102: # f
370
+ return 70 # F
371
+ else:
372
+ return c
373
+
374
+
375
+ cdef unsigned char* lowercase_ascii_and_validate(bytes src):
376
+ cdef Py_ssize_t src_len, range_start, i
377
+ cdef unsigned char* c_string
378
+ cdef unsigned char c
379
+
380
+ src_len = PyBytes_GET_SIZE(src)
381
+ c_string = src
382
+
383
+ with nogil:
384
+ # if c_string[0] == b"0" and c_string[1] in (b"X", b"x")
385
+ if c_string[0] == 48 and c_string[1] in (88, 120):
386
+ range_start = 2
387
+ else:
388
+ range_start = 0
389
+
390
+ for i in range(range_start, src_len):
391
+ c = c_string[i]
392
+
393
+ if 65 <= c <= 90:
394
+ c += 32
395
+ c_string[i] = c
396
+
397
+ if c == 48: # 0
398
+ pass
399
+ elif c == 49: # 1
400
+ pass
401
+ elif c == 50: # 2
402
+ pass
403
+ elif c == 51: # 3
404
+ pass
405
+ elif c == 52: # 4
406
+ pass
407
+ elif c == 53: # 5
408
+ pass
409
+ elif c == 54: # 6
410
+ pass
411
+ elif c == 55: # 7
412
+ pass
413
+ elif c == 56: # 8
414
+ pass
415
+ elif c == 57: # 9
416
+ pass
417
+ elif c == 97: # a
418
+ pass
419
+ elif c == 98: # b
420
+ pass
421
+ elif c == 99: # c
422
+ pass
423
+ elif c == 100: # d
424
+ pass
425
+ elif c == 101: # e
426
+ pass
427
+ elif c == 102: # f
428
+ pass
429
+ else:
430
+ with gil:
431
+ raise ValueError("when sending a str, it must be a hex string. " f"Got: {repr(src.decode('ascii'))}")
432
+
433
+ return c_string[range_start:]
434
+
435
+
436
+ del AnyAddress, ChecksumAddress
437
+ del keccak
@@ -0,0 +1,47 @@
1
+ from cchecksum._checksum import to_checksum_address
2
+
3
+
4
+ def monkey_patch_eth_utils() -> None:
5
+ """Monkey patch eth_utils to use cchecksum's implementation internally."""
6
+ import eth_utils
7
+ import eth_utils.address
8
+
9
+ eth_utils.to_checksum_address = to_checksum_address
10
+ eth_utils.address.to_checksum_address = to_checksum_address
11
+
12
+
13
+ def monkey_patch_web3py() -> None:
14
+ """Monkey patch web3.py to use cchecksum's implementation internally."""
15
+ import web3._utils as web3_utils
16
+ import web3.main as web3_main
17
+ import web3.middleware as web3_middleware
18
+
19
+ web3_main.to_checksum_address = to_checksum_address
20
+ web3_utils.ens.to_checksum_address = to_checksum_address
21
+ web3_utils.method_formatters.to_checksum_address = to_checksum_address
22
+ web3_utils.normalizers.to_checksum_address = to_checksum_address
23
+ web3_middleware.signing.to_checksum_address = to_checksum_address
24
+
25
+ try:
26
+ import web3.utils.address as web3_address
27
+
28
+ web3_address.to_checksum_address = to_checksum_address
29
+ except ModuleNotFoundError:
30
+ # youre on an older web3py, no monkey patch for you
31
+ pass
32
+
33
+ try:
34
+ import ens.ens
35
+
36
+ ens.ens.to_checksum_address = to_checksum_address
37
+ except ModuleNotFoundError:
38
+ # youre on an older web3py, no monkey patch for you
39
+ pass
40
+
41
+ try:
42
+ import ens.async_ens
43
+
44
+ ens.async_ens.to_checksum_address = to_checksum_address
45
+ except ModuleNotFoundError:
46
+ # youre on an older web3py, no monkey patch for you
47
+ pass
cchecksum/py.typed ADDED
File without changes
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: cchecksum
3
+ Version: 0.3.7.dev0
4
+ Summary: A ~8x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
5
+ Home-page: https://github.com/BobTheBuidler/cchecksum
6
+ Author: BobTheBuidler
7
+ Author-email: bobthebuidlerdefi@gmail.com
8
+ License: MIT
9
+ Requires-Python: >=3.8,<4
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: eth-hash
13
+ Requires-Dist: eth-typing
14
+ Requires-Dist: pysha3<2.0.0,>=1.0.0; python_version < "3.9"
15
+ Requires-Dist: safe-pysha3>=1.0.0; python_version >= "3.9"
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ ## CChecksum
28
+
29
+ [![PyPI](https://img.shields.io/pypi/v/cchecksum.svg?logo=Python&logoColor=white)](https://pypi.org/project/cchecksum/)
30
+ [![Monthly Downloads](https://img.shields.io/pypi/dm/cchecksum)](https://pypistats.org/packages/cchecksum)
31
+
32
+ CChecksum is a ~8x faster drop-in replacement for `eth_utils.to_checksum_address`, with the most cpu-intensive part implemented in C.
33
+
34
+ It keeps the exact same API as the existing implementation, exceptions and all.
35
+
36
+ Just `pip install cchecksum`, drop it in, and run your script with a substantial speed improvement.
37
+
38
+ ![image](https://github.com/user-attachments/assets/b989108f-350d-45a1-93c0-c1eaa3d8b801)
@@ -0,0 +1,12 @@
1
+ cchecksum/__init__.py,sha256=fafE-7zsvZEXsb9R-xAGud6-MaSgBPAD62ccWPGjQtw,437
2
+ cchecksum/_checksum.c,sha256=aH5U3NIShrvM5FqzyUVp-IQZOyD7skf9z-oCNjm7e4o,1182222
3
+ cchecksum/_checksum.cpython-314-i386-linux-musl.so,sha256=2gKm55q4nPwiLFld0ggwzH1GXMkrNVVsXrPKx_LbbVk,1139464
4
+ cchecksum/_checksum.pyi,sha256=4f0RJE47-cRH74C3ChN3JZqITUGtlg5wZtzuZaePm7g,2320
5
+ cchecksum/_checksum.pyx,sha256=MGEwvt8O3MVi7BkyiqtkbIuplI4UzarpwAiBgaPCUyI,14915
6
+ cchecksum/monkey_patch.py,sha256=ZCHPmfgeD6nOY9Gw2wU8d5qsBJMX-gymS-FryZ63IfQ,1540
7
+ cchecksum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ cchecksum-0.3.7.dev0.dist-info/METADATA,sha256=mg7e2_YIZ1dyQUOSwFbaeeb0SQ-JJ731NRG16azwIK0,1441
9
+ cchecksum-0.3.7.dev0.dist-info/WHEEL,sha256=2rSWyj1cRandbxJEJyuomjkW1LR7P9wlX7BYeUk-mjg,110
10
+ cchecksum-0.3.7.dev0.dist-info/top_level.txt,sha256=Qm8-fG-PzUlKgrtwwH508kIYkP63C2tRYA1qePeqAZQ,10
11
+ cchecksum-0.3.7.dev0.dist-info/RECORD,,
12
+ cchecksum-0.3.7.dev0.dist-info/licenses/LICENSE,sha256=qakxXN2B307yD6T3mvzxR7reyaih9WyLgpLoA3QoWdI,1070
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp314-cp314-musllinux_1_2_i686
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 BobTheBuidler
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ cchecksum