cchecksum 0.0.2__tar.gz → 0.0.4__tar.gz
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 cchecksum might be problematic. Click here for more details.
- {cchecksum-0.0.2 → cchecksum-0.0.4}/.github/workflows/pytest.yaml +1 -1
- {cchecksum-0.0.2 → cchecksum-0.0.4}/.gitignore +1 -0
- cchecksum-0.0.4/LICENSE +21 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/Makefile +3 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/PKG-INFO +3 -2
- cchecksum-0.0.4/README.md +7 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/_checksum.c +89 -100
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/_checksum.pyx +2 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/PKG-INFO +3 -2
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/SOURCES.txt +1 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/setup.py +1 -1
- cchecksum-0.0.2/README.md +0 -5
- {cchecksum-0.0.2 → cchecksum-0.0.4}/.github/workflows/black.yaml +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/.github/workflows/deploy-docs.yaml +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/.github/workflows/release.yaml +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/__init__.py +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/_cchecksum.pyi +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/checksum.py +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum/py.typed +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/dependency_links.txt +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/not-zip-safe +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/requires.txt +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/cchecksum.egg-info/top_level.txt +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/Makefile +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/alabaster.css +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/basic.css +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/custom.css +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/doctools.js +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/documentation_options.js +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/file.png +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/language_data.js +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/minus.png +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/plus.png +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/pygments.css +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/searchtools.js +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/_build/html/_static/sphinx_highlight.js +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/conf.py +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/index.rst +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/docs/make.bat +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/pyproject.toml +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/requirements.txt +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/setup.cfg +0 -0
- {cchecksum-0.0.2 → cchecksum-0.0.4}/test_checksum.py +0 -0
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
fail-fast: false
|
|
23
23
|
matrix:
|
|
24
24
|
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
|
25
|
-
pyversion: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
|
|
25
|
+
pyversion: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
|
|
26
26
|
exclude:
|
|
27
27
|
# gh runner throws "Error: Version ${{ matrix.pyversion }} with arch arm64 not found"
|
|
28
28
|
- os: macos-latest
|
cchecksum-0.0.4/LICENSE
ADDED
|
@@ -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.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cchecksum
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: A ~2x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
|
|
5
5
|
Home-page: https://github.com/BobTheBuidler/cchecksum
|
|
6
6
|
Author: BobTheBuidler
|
|
7
7
|
Author-email: bobthebuidlerdefi@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
-
Requires-Python: >=3.8,<
|
|
9
|
+
Requires-Python: >=3.8,<4
|
|
10
|
+
License-File: LICENSE
|
|
10
11
|
Requires-Dist: eth-typing
|
|
11
12
|
Requires-Dist: eth-utils
|
|
12
13
|
Requires-Dist: pysha3<2.0.0,>=1.0.0; python_version < "3.9"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## CChecksum
|
|
2
|
+
|
|
3
|
+
CChecksum is a ~2x faster drop-in replacement for eth_utils.to_checksum_address, with the most cpu-intensive part implemented in c.
|
|
4
|
+
|
|
5
|
+
Just `pip install cchecksum`, drop it in, and run your script with a substantial speed improvement.
|
|
6
|
+
|
|
7
|
+

|
|
@@ -2585,9 +2585,6 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
|
|
|
2585
2585
|
/* HasAttr.proto */
|
|
2586
2586
|
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
|
|
2587
2587
|
|
|
2588
|
-
/* BufferIndexError.proto */
|
|
2589
|
-
static void __Pyx_RaiseBufferIndexError(int axis);
|
|
2590
|
-
|
|
2591
2588
|
/* decode_c_string_utf16.proto */
|
|
2592
2589
|
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
|
|
2593
2590
|
int byteorder = 0;
|
|
@@ -3150,7 +3147,7 @@ static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
|
|
|
3150
3147
|
static const char __pyx_k_norm_address_mv[] = "norm_address_mv";
|
|
3151
3148
|
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
|
|
3152
3149
|
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
|
|
3153
|
-
static const char
|
|
3150
|
+
static const char __pyx_k_cchecksum_line_3[] = "cchecksum (line 3)";
|
|
3154
3151
|
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
|
|
3155
3152
|
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
|
|
3156
3153
|
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
|
|
@@ -3324,7 +3321,7 @@ typedef struct {
|
|
|
3324
3321
|
PyObject *__pyx_n_s_cchecksum;
|
|
3325
3322
|
PyObject *__pyx_n_s_cchecksum__checksum;
|
|
3326
3323
|
PyObject *__pyx_kp_s_cchecksum__checksum_pyx;
|
|
3327
|
-
PyObject *
|
|
3324
|
+
PyObject *__pyx_kp_u_cchecksum_line_3;
|
|
3328
3325
|
PyObject *__pyx_n_s_class;
|
|
3329
3326
|
PyObject *__pyx_n_s_class_getitem;
|
|
3330
3327
|
PyObject *__pyx_n_s_cline_in_traceback;
|
|
@@ -3532,7 +3529,7 @@ static int __pyx_m_clear(PyObject *m) {
|
|
|
3532
3529
|
Py_CLEAR(clear_module_state->__pyx_n_s_cchecksum);
|
|
3533
3530
|
Py_CLEAR(clear_module_state->__pyx_n_s_cchecksum__checksum);
|
|
3534
3531
|
Py_CLEAR(clear_module_state->__pyx_kp_s_cchecksum__checksum_pyx);
|
|
3535
|
-
Py_CLEAR(clear_module_state->
|
|
3532
|
+
Py_CLEAR(clear_module_state->__pyx_kp_u_cchecksum_line_3);
|
|
3536
3533
|
Py_CLEAR(clear_module_state->__pyx_n_s_class);
|
|
3537
3534
|
Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
|
|
3538
3535
|
Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
|
|
@@ -3718,7 +3715,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
|
3718
3715
|
Py_VISIT(traverse_module_state->__pyx_n_s_cchecksum);
|
|
3719
3716
|
Py_VISIT(traverse_module_state->__pyx_n_s_cchecksum__checksum);
|
|
3720
3717
|
Py_VISIT(traverse_module_state->__pyx_kp_s_cchecksum__checksum_pyx);
|
|
3721
|
-
Py_VISIT(traverse_module_state->
|
|
3718
|
+
Py_VISIT(traverse_module_state->__pyx_kp_u_cchecksum_line_3);
|
|
3722
3719
|
Py_VISIT(traverse_module_state->__pyx_n_s_class);
|
|
3723
3720
|
Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
|
|
3724
3721
|
Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
|
|
@@ -3914,7 +3911,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
|
3914
3911
|
#define __pyx_n_s_cchecksum __pyx_mstate_global->__pyx_n_s_cchecksum
|
|
3915
3912
|
#define __pyx_n_s_cchecksum__checksum __pyx_mstate_global->__pyx_n_s_cchecksum__checksum
|
|
3916
3913
|
#define __pyx_kp_s_cchecksum__checksum_pyx __pyx_mstate_global->__pyx_kp_s_cchecksum__checksum_pyx
|
|
3917
|
-
#define
|
|
3914
|
+
#define __pyx_kp_u_cchecksum_line_3 __pyx_mstate_global->__pyx_kp_u_cchecksum_line_3
|
|
3918
3915
|
#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
|
|
3919
3916
|
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
|
|
3920
3917
|
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
|
|
@@ -18007,7 +18004,9 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
|
|
|
18007
18004
|
return __pyx_r;
|
|
18008
18005
|
}
|
|
18009
18006
|
|
|
18010
|
-
/* "cchecksum/_checksum.pyx":
|
|
18007
|
+
/* "cchecksum/_checksum.pyx":3
|
|
18008
|
+
* # cython: boundscheck=False
|
|
18009
|
+
*
|
|
18011
18010
|
* def cchecksum(str norm_address_no_0x, str address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
18012
18011
|
* """
|
|
18013
18012
|
* Computes the checksummed version of an Ethereum address.
|
|
@@ -18070,7 +18069,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18070
18069
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
|
18071
18070
|
kw_args--;
|
|
18072
18071
|
}
|
|
18073
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
|
18072
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
|
|
18074
18073
|
else goto __pyx_L5_argtuple_error;
|
|
18075
18074
|
CYTHON_FALLTHROUGH;
|
|
18076
18075
|
case 1:
|
|
@@ -18078,14 +18077,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18078
18077
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
|
|
18079
18078
|
kw_args--;
|
|
18080
18079
|
}
|
|
18081
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
|
18080
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
|
|
18082
18081
|
else {
|
|
18083
|
-
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, 1); __PYX_ERR(0,
|
|
18082
|
+
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, 1); __PYX_ERR(0, 3, __pyx_L3_error)
|
|
18084
18083
|
}
|
|
18085
18084
|
}
|
|
18086
18085
|
if (unlikely(kw_args > 0)) {
|
|
18087
18086
|
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
18088
|
-
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cchecksum") < 0)) __PYX_ERR(0,
|
|
18087
|
+
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cchecksum") < 0)) __PYX_ERR(0, 3, __pyx_L3_error)
|
|
18089
18088
|
}
|
|
18090
18089
|
} else if (unlikely(__pyx_nargs != 2)) {
|
|
18091
18090
|
goto __pyx_L5_argtuple_error;
|
|
@@ -18098,7 +18097,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18098
18097
|
}
|
|
18099
18098
|
goto __pyx_L6_skip;
|
|
18100
18099
|
__pyx_L5_argtuple_error:;
|
|
18101
|
-
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0,
|
|
18100
|
+
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
|
|
18102
18101
|
__pyx_L6_skip:;
|
|
18103
18102
|
goto __pyx_L4_argument_unpacking_done;
|
|
18104
18103
|
__pyx_L3_error:;
|
|
@@ -18112,8 +18111,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18112
18111
|
__Pyx_RefNannyFinishContext();
|
|
18113
18112
|
return NULL;
|
|
18114
18113
|
__pyx_L4_argument_unpacking_done:;
|
|
18115
|
-
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_norm_address_no_0x), (&PyUnicode_Type), 1, "norm_address_no_0x", 1))) __PYX_ERR(0,
|
|
18116
|
-
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address_hash_hex_no_0x), (&PyUnicode_Type), 1, "address_hash_hex_no_0x", 1))) __PYX_ERR(0,
|
|
18114
|
+
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_norm_address_no_0x), (&PyUnicode_Type), 1, "norm_address_no_0x", 1))) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
18115
|
+
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address_hash_hex_no_0x), (&PyUnicode_Type), 1, "address_hash_hex_no_0x", 1))) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
18117
18116
|
__pyx_r = __pyx_pf_9cchecksum_9_checksum_cchecksum(__pyx_self, __pyx_v_norm_address_no_0x, __pyx_v_address_hash_hex_no_0x);
|
|
18118
18117
|
|
|
18119
18118
|
/* function exit code */
|
|
@@ -18147,141 +18146,124 @@ static PyObject *__pyx_pf_9cchecksum_9_checksum_cchecksum(CYTHON_UNUSED PyObject
|
|
|
18147
18146
|
int __pyx_t_5;
|
|
18148
18147
|
Py_ssize_t __pyx_t_6;
|
|
18149
18148
|
int __pyx_t_7;
|
|
18150
|
-
|
|
18151
|
-
long __pyx_t_9;
|
|
18149
|
+
long __pyx_t_8;
|
|
18152
18150
|
int __pyx_lineno = 0;
|
|
18153
18151
|
const char *__pyx_filename = NULL;
|
|
18154
18152
|
int __pyx_clineno = 0;
|
|
18155
18153
|
__Pyx_TraceFrameInit(__pyx_codeobj__9)
|
|
18156
18154
|
__Pyx_RefNannySetupContext("cchecksum", 1);
|
|
18157
|
-
__Pyx_TraceCall("cchecksum", __pyx_f[0],
|
|
18155
|
+
__Pyx_TraceCall("cchecksum", __pyx_f[0], 3, 0, __PYX_ERR(0, 3, __pyx_L1_error));
|
|
18158
18156
|
|
|
18159
|
-
/* "cchecksum/_checksum.pyx":
|
|
18157
|
+
/* "cchecksum/_checksum.pyx":30
|
|
18160
18158
|
*
|
|
18161
18159
|
* # Declare memoryviews for fixed-length data
|
|
18162
18160
|
* cdef unsigned char[::1] norm_address_mv = bytearray(norm_address_no_0x.encode('ascii')) # <<<<<<<<<<<<<<
|
|
18163
18161
|
* cdef unsigned char[::1] hash_bytes_mv = bytearray(address_hash_hex_no_0x.encode('ascii'))
|
|
18164
18162
|
*
|
|
18165
18163
|
*/
|
|
18166
|
-
__Pyx_TraceLine(
|
|
18164
|
+
__Pyx_TraceLine(30,0,__PYX_ERR(0, 30, __pyx_L1_error))
|
|
18167
18165
|
if (unlikely(__pyx_v_norm_address_no_0x == Py_None)) {
|
|
18168
18166
|
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
|
|
18169
|
-
__PYX_ERR(0,
|
|
18167
|
+
__PYX_ERR(0, 30, __pyx_L1_error)
|
|
18170
18168
|
}
|
|
18171
|
-
__pyx_t_1 = PyUnicode_AsASCIIString(__pyx_v_norm_address_no_0x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18169
|
+
__pyx_t_1 = PyUnicode_AsASCIIString(__pyx_v_norm_address_no_0x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
|
|
18172
18170
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18173
|
-
__pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0,
|
|
18171
|
+
__pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
|
|
18174
18172
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18175
18173
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18176
|
-
__pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0,
|
|
18174
|
+
__pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 30, __pyx_L1_error)
|
|
18177
18175
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18178
18176
|
__pyx_v_norm_address_mv = __pyx_t_3;
|
|
18179
18177
|
__pyx_t_3.memview = NULL;
|
|
18180
18178
|
__pyx_t_3.data = NULL;
|
|
18181
18179
|
|
|
18182
|
-
/* "cchecksum/_checksum.pyx":
|
|
18180
|
+
/* "cchecksum/_checksum.pyx":31
|
|
18183
18181
|
* # Declare memoryviews for fixed-length data
|
|
18184
18182
|
* cdef unsigned char[::1] norm_address_mv = bytearray(norm_address_no_0x.encode('ascii'))
|
|
18185
18183
|
* cdef unsigned char[::1] hash_bytes_mv = bytearray(address_hash_hex_no_0x.encode('ascii')) # <<<<<<<<<<<<<<
|
|
18186
18184
|
*
|
|
18187
18185
|
* # Create a buffer for our result
|
|
18188
18186
|
*/
|
|
18189
|
-
__Pyx_TraceLine(
|
|
18187
|
+
__Pyx_TraceLine(31,0,__PYX_ERR(0, 31, __pyx_L1_error))
|
|
18190
18188
|
if (unlikely(__pyx_v_address_hash_hex_no_0x == Py_None)) {
|
|
18191
18189
|
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
|
|
18192
|
-
__PYX_ERR(0,
|
|
18190
|
+
__PYX_ERR(0, 31, __pyx_L1_error)
|
|
18193
18191
|
}
|
|
18194
|
-
__pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_address_hash_hex_no_0x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0,
|
|
18192
|
+
__pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_address_hash_hex_no_0x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
|
|
18195
18193
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18196
|
-
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18194
|
+
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
|
|
18197
18195
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18198
18196
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18199
|
-
__pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0,
|
|
18197
|
+
__pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 31, __pyx_L1_error)
|
|
18200
18198
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18201
18199
|
__pyx_v_hash_bytes_mv = __pyx_t_3;
|
|
18202
18200
|
__pyx_t_3.memview = NULL;
|
|
18203
18201
|
__pyx_t_3.data = NULL;
|
|
18204
18202
|
|
|
18205
|
-
/* "cchecksum/_checksum.pyx":
|
|
18203
|
+
/* "cchecksum/_checksum.pyx":35
|
|
18206
18204
|
* # Create a buffer for our result
|
|
18207
18205
|
* # 2 for "0x" prefix and 40 for the address itself
|
|
18208
18206
|
* cdef unsigned char[42] buffer = b'0x' + bytearray(40) # <<<<<<<<<<<<<<
|
|
18209
18207
|
*
|
|
18210
18208
|
* # Handle character casing based on the hash value
|
|
18211
18209
|
*/
|
|
18212
|
-
__Pyx_TraceLine(
|
|
18213
|
-
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18210
|
+
__Pyx_TraceLine(35,0,__PYX_ERR(0, 35, __pyx_L1_error))
|
|
18211
|
+
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
18214
18212
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18215
|
-
__pyx_t_2 = PyNumber_Add(__pyx_kp_b_0x, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0,
|
|
18213
|
+
__pyx_t_2 = PyNumber_Add(__pyx_kp_b_0x, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
18216
18214
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18217
18215
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18218
|
-
if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_t_2, __pyx_t_4, 42) < 0))) __PYX_ERR(0,
|
|
18216
|
+
if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_t_2, __pyx_t_4, 42) < 0))) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
18219
18217
|
memcpy(&(__pyx_v_buffer[0]), __pyx_t_4, sizeof(__pyx_v_buffer[0]) * (42));
|
|
18220
18218
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18221
18219
|
|
|
18222
|
-
/* "cchecksum/_checksum.pyx":
|
|
18220
|
+
/* "cchecksum/_checksum.pyx":41
|
|
18223
18221
|
* cdef int address_char
|
|
18224
18222
|
*
|
|
18225
18223
|
* for i in range(40): # <<<<<<<<<<<<<<
|
|
18226
18224
|
* address_char = norm_address_mv[i]
|
|
18227
18225
|
*
|
|
18228
18226
|
*/
|
|
18229
|
-
__Pyx_TraceLine(
|
|
18227
|
+
__Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
|
|
18230
18228
|
for (__pyx_t_5 = 0; __pyx_t_5 < 40; __pyx_t_5+=1) {
|
|
18231
18229
|
__pyx_v_i = __pyx_t_5;
|
|
18232
18230
|
|
|
18233
|
-
/* "cchecksum/_checksum.pyx":
|
|
18231
|
+
/* "cchecksum/_checksum.pyx":42
|
|
18234
18232
|
*
|
|
18235
18233
|
* for i in range(40):
|
|
18236
18234
|
* address_char = norm_address_mv[i] # <<<<<<<<<<<<<<
|
|
18237
18235
|
*
|
|
18238
18236
|
* if hash_bytes_mv[i] < 56:
|
|
18239
18237
|
*/
|
|
18240
|
-
__Pyx_TraceLine(
|
|
18238
|
+
__Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error))
|
|
18241
18239
|
__pyx_t_6 = __pyx_v_i;
|
|
18242
|
-
|
|
18243
|
-
if (__pyx_t_6 < 0) {
|
|
18244
|
-
__pyx_t_6 += __pyx_v_norm_address_mv.shape[0];
|
|
18245
|
-
if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
|
|
18246
|
-
} else if (unlikely(__pyx_t_6 >= __pyx_v_norm_address_mv.shape[0])) __pyx_t_7 = 0;
|
|
18247
|
-
if (unlikely(__pyx_t_7 != -1)) {
|
|
18248
|
-
__Pyx_RaiseBufferIndexError(__pyx_t_7);
|
|
18249
|
-
__PYX_ERR(0, 40, __pyx_L1_error)
|
|
18250
|
-
}
|
|
18240
|
+
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_norm_address_mv.shape[0];
|
|
18251
18241
|
__pyx_v_address_char = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_norm_address_mv.data) + __pyx_t_6)) )));
|
|
18252
18242
|
|
|
18253
|
-
/* "cchecksum/_checksum.pyx":
|
|
18243
|
+
/* "cchecksum/_checksum.pyx":44
|
|
18254
18244
|
* address_char = norm_address_mv[i]
|
|
18255
18245
|
*
|
|
18256
18246
|
* if hash_bytes_mv[i] < 56: # <<<<<<<<<<<<<<
|
|
18257
18247
|
* # '0' to '7' have ASCII values 48 to 55
|
|
18258
18248
|
* buffer[i + 2] = address_char
|
|
18259
18249
|
*/
|
|
18260
|
-
__Pyx_TraceLine(
|
|
18250
|
+
__Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error))
|
|
18261
18251
|
__pyx_t_6 = __pyx_v_i;
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
|
|
18266
|
-
} else if (unlikely(__pyx_t_6 >= __pyx_v_hash_bytes_mv.shape[0])) __pyx_t_7 = 0;
|
|
18267
|
-
if (unlikely(__pyx_t_7 != -1)) {
|
|
18268
|
-
__Pyx_RaiseBufferIndexError(__pyx_t_7);
|
|
18269
|
-
__PYX_ERR(0, 42, __pyx_L1_error)
|
|
18270
|
-
}
|
|
18271
|
-
__pyx_t_8 = ((*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_hash_bytes_mv.data) + __pyx_t_6)) ))) < 56);
|
|
18272
|
-
if (__pyx_t_8) {
|
|
18252
|
+
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_hash_bytes_mv.shape[0];
|
|
18253
|
+
__pyx_t_7 = ((*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_hash_bytes_mv.data) + __pyx_t_6)) ))) < 56);
|
|
18254
|
+
if (__pyx_t_7) {
|
|
18273
18255
|
|
|
18274
|
-
/* "cchecksum/_checksum.pyx":
|
|
18256
|
+
/* "cchecksum/_checksum.pyx":46
|
|
18275
18257
|
* if hash_bytes_mv[i] < 56:
|
|
18276
18258
|
* # '0' to '7' have ASCII values 48 to 55
|
|
18277
18259
|
* buffer[i + 2] = address_char # <<<<<<<<<<<<<<
|
|
18278
18260
|
*
|
|
18279
18261
|
* else:
|
|
18280
18262
|
*/
|
|
18281
|
-
__Pyx_TraceLine(
|
|
18263
|
+
__Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error))
|
|
18282
18264
|
(__pyx_v_buffer[(__pyx_v_i + 2)]) = __pyx_v_address_char;
|
|
18283
18265
|
|
|
18284
|
-
/* "cchecksum/_checksum.pyx":
|
|
18266
|
+
/* "cchecksum/_checksum.pyx":44
|
|
18285
18267
|
* address_char = norm_address_mv[i]
|
|
18286
18268
|
*
|
|
18287
18269
|
* if hash_bytes_mv[i] < 56: # <<<<<<<<<<<<<<
|
|
@@ -18291,49 +18273,51 @@ static PyObject *__pyx_pf_9cchecksum_9_checksum_cchecksum(CYTHON_UNUSED PyObject
|
|
|
18291
18273
|
goto __pyx_L5;
|
|
18292
18274
|
}
|
|
18293
18275
|
|
|
18294
|
-
/* "cchecksum/_checksum.pyx":
|
|
18276
|
+
/* "cchecksum/_checksum.pyx":52
|
|
18295
18277
|
* # characters ('a' to 'f'), which correspond to ASCII values 97 to 102. If it does,
|
|
18296
18278
|
* # the character is capitalized.
|
|
18297
18279
|
* buffer[i + 2] = address_char - 32 if 97 <= address_char <= 102 else address_char # <<<<<<<<<<<<<<
|
|
18298
18280
|
*
|
|
18299
18281
|
* # NOTE: For some reason on some systems the buffer length is longer than 42 here, even though that should not be possible.
|
|
18300
18282
|
*/
|
|
18301
|
-
__Pyx_TraceLine(
|
|
18283
|
+
__Pyx_TraceLine(52,0,__PYX_ERR(0, 52, __pyx_L1_error))
|
|
18302
18284
|
/*else*/ {
|
|
18303
|
-
|
|
18304
|
-
if (
|
|
18305
|
-
|
|
18285
|
+
__pyx_t_7 = (97 <= __pyx_v_address_char);
|
|
18286
|
+
if (__pyx_t_7) {
|
|
18287
|
+
__pyx_t_7 = (__pyx_v_address_char <= 0x66);
|
|
18306
18288
|
}
|
|
18307
|
-
if (
|
|
18308
|
-
|
|
18289
|
+
if (__pyx_t_7) {
|
|
18290
|
+
__pyx_t_8 = (__pyx_v_address_char - 32);
|
|
18309
18291
|
} else {
|
|
18310
|
-
|
|
18292
|
+
__pyx_t_8 = __pyx_v_address_char;
|
|
18311
18293
|
}
|
|
18312
|
-
(__pyx_v_buffer[(__pyx_v_i + 2)]) =
|
|
18294
|
+
(__pyx_v_buffer[(__pyx_v_i + 2)]) = __pyx_t_8;
|
|
18313
18295
|
}
|
|
18314
18296
|
__pyx_L5:;
|
|
18315
18297
|
}
|
|
18316
18298
|
|
|
18317
|
-
/* "cchecksum/_checksum.pyx":
|
|
18299
|
+
/* "cchecksum/_checksum.pyx":56
|
|
18318
18300
|
* # NOTE: For some reason on some systems the buffer length is longer than 42 here, even though that should not be possible.
|
|
18319
18301
|
* # Lucky for us, the first 42 characters are always correct. One day maybe I'll debug this.
|
|
18320
18302
|
* return bytes(buffer[:42]).decode('ascii') # <<<<<<<<<<<<<<
|
|
18321
18303
|
*/
|
|
18322
|
-
__Pyx_TraceLine(
|
|
18304
|
+
__Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error))
|
|
18323
18305
|
__Pyx_XDECREF(__pyx_r);
|
|
18324
|
-
__pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_buffer) + 0, 42 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0,
|
|
18306
|
+
__pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_buffer) + 0, 42 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
|
|
18325
18307
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18326
|
-
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18308
|
+
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
|
|
18327
18309
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18328
18310
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18329
|
-
__pyx_t_2 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0,
|
|
18311
|
+
__pyx_t_2 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
|
|
18330
18312
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18331
18313
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18332
18314
|
__pyx_r = ((PyObject*)__pyx_t_2);
|
|
18333
18315
|
__pyx_t_2 = 0;
|
|
18334
18316
|
goto __pyx_L0;
|
|
18335
18317
|
|
|
18336
|
-
/* "cchecksum/_checksum.pyx":
|
|
18318
|
+
/* "cchecksum/_checksum.pyx":3
|
|
18319
|
+
* # cython: boundscheck=False
|
|
18320
|
+
*
|
|
18337
18321
|
* def cchecksum(str norm_address_no_0x, str address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
18338
18322
|
* """
|
|
18339
18323
|
* Computes the checksummed version of an Ethereum address.
|
|
@@ -19381,7 +19365,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
|
19381
19365
|
{&__pyx_n_s_cchecksum, __pyx_k_cchecksum, sizeof(__pyx_k_cchecksum), 0, 0, 1, 1},
|
|
19382
19366
|
{&__pyx_n_s_cchecksum__checksum, __pyx_k_cchecksum__checksum, sizeof(__pyx_k_cchecksum__checksum), 0, 0, 1, 1},
|
|
19383
19367
|
{&__pyx_kp_s_cchecksum__checksum_pyx, __pyx_k_cchecksum__checksum_pyx, sizeof(__pyx_k_cchecksum__checksum_pyx), 0, 0, 1, 0},
|
|
19384
|
-
{&
|
|
19368
|
+
{&__pyx_kp_u_cchecksum_line_3, __pyx_k_cchecksum_line_3, sizeof(__pyx_k_cchecksum_line_3), 0, 1, 0, 0},
|
|
19385
19369
|
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
|
|
19386
19370
|
{&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
|
|
19387
19371
|
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
|
|
@@ -19468,7 +19452,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
|
19468
19452
|
}
|
|
19469
19453
|
/* #### Code section: cached_builtins ### */
|
|
19470
19454
|
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
|
19471
|
-
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0,
|
|
19455
|
+
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 41, __pyx_L1_error)
|
|
19472
19456
|
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 83, __pyx_L1_error)
|
|
19473
19457
|
__pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 83, __pyx_L1_error)
|
|
19474
19458
|
__pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 86, __pyx_L1_error)
|
|
@@ -19525,14 +19509,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
19525
19509
|
__Pyx_GOTREF(__pyx_tuple__8);
|
|
19526
19510
|
__Pyx_GIVEREF(__pyx_tuple__8);
|
|
19527
19511
|
|
|
19528
|
-
/* "cchecksum/_checksum.pyx":
|
|
19512
|
+
/* "cchecksum/_checksum.pyx":35
|
|
19529
19513
|
* # Create a buffer for our result
|
|
19530
19514
|
* # 2 for "0x" prefix and 40 for the address itself
|
|
19531
19515
|
* cdef unsigned char[42] buffer = b'0x' + bytearray(40) # <<<<<<<<<<<<<<
|
|
19532
19516
|
*
|
|
19533
19517
|
* # Handle character casing based on the hash value
|
|
19534
19518
|
*/
|
|
19535
|
-
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_40); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0,
|
|
19519
|
+
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_40); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
19536
19520
|
__Pyx_GOTREF(__pyx_tuple__10);
|
|
19537
19521
|
__Pyx_GIVEREF(__pyx_tuple__10);
|
|
19538
19522
|
|
|
@@ -19637,15 +19621,17 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
19637
19621
|
__Pyx_GIVEREF(__pyx_tuple__20);
|
|
19638
19622
|
__pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
19639
19623
|
|
|
19640
|
-
/* "cchecksum/_checksum.pyx":
|
|
19624
|
+
/* "cchecksum/_checksum.pyx":3
|
|
19625
|
+
* # cython: boundscheck=False
|
|
19626
|
+
*
|
|
19641
19627
|
* def cchecksum(str norm_address_no_0x, str address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
19642
19628
|
* """
|
|
19643
19629
|
* Computes the checksummed version of an Ethereum address.
|
|
19644
19630
|
*/
|
|
19645
|
-
__pyx_tuple__22 = PyTuple_Pack(7, __pyx_n_s_norm_address_no_0x, __pyx_n_s_address_hash_hex_no_0x, __pyx_n_s_norm_address_mv, __pyx_n_s_hash_bytes_mv, __pyx_n_s_buffer, __pyx_n_s_i, __pyx_n_s_address_char); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0,
|
|
19631
|
+
__pyx_tuple__22 = PyTuple_Pack(7, __pyx_n_s_norm_address_no_0x, __pyx_n_s_address_hash_hex_no_0x, __pyx_n_s_norm_address_mv, __pyx_n_s_hash_bytes_mv, __pyx_n_s_buffer, __pyx_n_s_i, __pyx_n_s_address_char); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
19646
19632
|
__Pyx_GOTREF(__pyx_tuple__22);
|
|
19647
19633
|
__Pyx_GIVEREF(__pyx_tuple__22);
|
|
19648
|
-
__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cchecksum__checksum_pyx, __pyx_n_s_cchecksum,
|
|
19634
|
+
__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cchecksum__checksum_pyx, __pyx_n_s_cchecksum, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
19649
19635
|
__Pyx_RefNannyFinishContext();
|
|
19650
19636
|
return 0;
|
|
19651
19637
|
__pyx_L1_error:;
|
|
@@ -20709,24 +20695,33 @@ if (!__Pyx_RefNanny) {
|
|
|
20709
20695
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
20710
20696
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
20711
20697
|
|
|
20712
|
-
/* "cchecksum/_checksum.pyx":
|
|
20698
|
+
/* "cchecksum/_checksum.pyx":3
|
|
20699
|
+
* # cython: boundscheck=False
|
|
20700
|
+
*
|
|
20713
20701
|
* def cchecksum(str norm_address_no_0x, str address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
20714
20702
|
* """
|
|
20715
20703
|
* Computes the checksummed version of an Ethereum address.
|
|
20716
20704
|
*/
|
|
20717
|
-
__Pyx_TraceLine(
|
|
20718
|
-
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0,
|
|
20705
|
+
__Pyx_TraceLine(3,0,__PYX_ERR(0, 3, __pyx_L1_error))
|
|
20706
|
+
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
20719
20707
|
__Pyx_GOTREF(__pyx_t_7);
|
|
20720
|
-
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0,
|
|
20721
|
-
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9cchecksum_9_checksum_1cchecksum, 0, __pyx_n_s_cchecksum, NULL, __pyx_n_s_cchecksum__checksum, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0,
|
|
20708
|
+
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
20709
|
+
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9cchecksum_9_checksum_1cchecksum, 0, __pyx_n_s_cchecksum, NULL, __pyx_n_s_cchecksum__checksum, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
20722
20710
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20723
20711
|
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
|
|
20724
20712
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
20725
|
-
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cchecksum, __pyx_t_4) < 0) __PYX_ERR(0,
|
|
20713
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cchecksum, __pyx_t_4) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
|
|
20726
20714
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
20715
|
+
|
|
20716
|
+
/* "cchecksum/_checksum.pyx":1
|
|
20717
|
+
* # cython: boundscheck=False # <<<<<<<<<<<<<<
|
|
20718
|
+
*
|
|
20719
|
+
* def cchecksum(str norm_address_no_0x, str address_hash_hex_no_0x) -> str:
|
|
20720
|
+
*/
|
|
20721
|
+
__Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
|
|
20727
20722
|
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20728
20723
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20729
|
-
if (PyDict_SetItem(__pyx_t_4,
|
|
20724
|
+
if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_cchecksum_line_3, __pyx_kp_u_Computes_the_checksummed_versio) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20730
20725
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20731
20726
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
20732
20727
|
__Pyx_TraceReturn(Py_None, 0);
|
|
@@ -23305,12 +23300,6 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
|
|
|
23305
23300
|
}
|
|
23306
23301
|
}
|
|
23307
23302
|
|
|
23308
|
-
/* BufferIndexError */
|
|
23309
|
-
static void __Pyx_RaiseBufferIndexError(int axis) {
|
|
23310
|
-
PyErr_Format(PyExc_IndexError,
|
|
23311
|
-
"Out of bounds on buffer access (axis %d)", axis);
|
|
23312
|
-
}
|
|
23313
|
-
|
|
23314
23303
|
/* decode_c_bytes */
|
|
23315
23304
|
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
|
|
23316
23305
|
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cchecksum
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: A ~2x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
|
|
5
5
|
Home-page: https://github.com/BobTheBuidler/cchecksum
|
|
6
6
|
Author: BobTheBuidler
|
|
7
7
|
Author-email: bobthebuidlerdefi@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
-
Requires-Python: >=3.8,<
|
|
9
|
+
Requires-Python: >=3.8,<4
|
|
10
|
+
License-File: LICENSE
|
|
10
11
|
Requires-Dist: eth-typing
|
|
11
12
|
Requires-Dist: eth-utils
|
|
12
13
|
Requires-Dist: pysha3<2.0.0,>=1.0.0; python_version < "3.9"
|
cchecksum-0.0.2/README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|