cchecksum 0.0.9__tar.gz → 0.0.11__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.9 → cchecksum-0.0.11}/.github/workflows/deploy-docs.yaml +6 -3
- {cchecksum-0.0.9/cchecksum.egg-info → cchecksum-0.0.11}/PKG-INFO +1 -1
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/_checksum.c +73 -96
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/_checksum.pyi +1 -1
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/_checksum.pyx +2 -1
- {cchecksum-0.0.9 → cchecksum-0.0.11/cchecksum.egg-info}/PKG-INFO +1 -1
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/conf.py +1 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/.github/workflows/black.yaml +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/.github/workflows/pytest.yaml +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/.github/workflows/release.yaml +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/.gitignore +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/LICENSE +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/Makefile +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/README.md +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/__init__.py +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/checksum.py +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/checksum.pyi +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum/py.typed +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum.egg-info/SOURCES.txt +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum.egg-info/dependency_links.txt +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum.egg-info/not-zip-safe +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum.egg-info/requires.txt +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/cchecksum.egg-info/top_level.txt +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/Makefile +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/alabaster.css +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/basic.css +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/custom.css +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/doctools.js +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/documentation_options.js +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/file.png +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/language_data.js +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/minus.png +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/plus.png +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/pygments.css +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/searchtools.js +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/_build/html/_static/sphinx_highlight.js +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/index.rst +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/docs/make.bat +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/pyproject.toml +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/requirements.txt +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/setup.cfg +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/setup.py +0 -0
- {cchecksum-0.0.9 → cchecksum-0.0.11}/test_checksum.py +0 -0
|
@@ -5,6 +5,9 @@ on:
|
|
|
5
5
|
branches:
|
|
6
6
|
- master
|
|
7
7
|
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
8
11
|
|
|
9
12
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
10
13
|
permissions:
|
|
@@ -16,13 +19,12 @@ permissions:
|
|
|
16
19
|
jobs:
|
|
17
20
|
build-and-deploy:
|
|
18
21
|
runs-on: ubuntu-latest
|
|
19
|
-
|
|
20
|
-
environment:
|
|
21
|
-
name: github-pages
|
|
22
22
|
|
|
23
23
|
steps:
|
|
24
24
|
- name: Check out code
|
|
25
25
|
uses: actions/checkout@v2
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
26
28
|
|
|
27
29
|
- name: Set up Python
|
|
28
30
|
uses: actions/setup-python@v2
|
|
@@ -55,6 +57,7 @@ jobs:
|
|
|
55
57
|
uses: actions/checkout@v4
|
|
56
58
|
with:
|
|
57
59
|
ref: gh-pages
|
|
60
|
+
persist-credentials: false
|
|
58
61
|
|
|
59
62
|
- name: Setup Pages
|
|
60
63
|
uses: actions/configure-pages@v4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cchecksum
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
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
|
|
@@ -2599,32 +2599,12 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_s
|
|
|
2599
2599
|
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
|
|
2600
2600
|
}
|
|
2601
2601
|
|
|
2602
|
-
/*
|
|
2603
|
-
static CYTHON_INLINE PyObject*
|
|
2604
|
-
const char* cstring, Py_ssize_t
|
|
2602
|
+
/* decode_c_string.proto */
|
|
2603
|
+
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
|
|
2604
|
+
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
|
|
2605
2605
|
const char* encoding, const char* errors,
|
|
2606
2606
|
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
|
|
2607
2607
|
|
|
2608
|
-
/* decode_bytes.proto */
|
|
2609
|
-
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
|
|
2610
|
-
PyObject* string, Py_ssize_t start, Py_ssize_t stop,
|
|
2611
|
-
const char* encoding, const char* errors,
|
|
2612
|
-
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
|
|
2613
|
-
char* as_c_string;
|
|
2614
|
-
Py_ssize_t size;
|
|
2615
|
-
#if CYTHON_ASSUME_SAFE_MACROS
|
|
2616
|
-
as_c_string = PyBytes_AS_STRING(string);
|
|
2617
|
-
size = PyBytes_GET_SIZE(string);
|
|
2618
|
-
#else
|
|
2619
|
-
if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) {
|
|
2620
|
-
return NULL;
|
|
2621
|
-
}
|
|
2622
|
-
#endif
|
|
2623
|
-
return __Pyx_decode_c_bytes(
|
|
2624
|
-
as_c_string, size,
|
|
2625
|
-
start, stop, encoding, errors, decode_func);
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
2608
|
/* PyObject_GenericGetAttrNoDict.proto */
|
|
2629
2609
|
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
|
|
2630
2610
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
|
|
@@ -3146,7 +3126,7 @@ static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
|
|
|
3146
3126
|
static const char __pyx_k_norm_address_mv[] = "norm_address_mv";
|
|
3147
3127
|
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
|
|
3148
3128
|
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
|
|
3149
|
-
static const char
|
|
3129
|
+
static const char __pyx_k_cchecksum_line_4[] = "cchecksum (line 4)";
|
|
3150
3130
|
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
|
|
3151
3131
|
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
|
|
3152
3132
|
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
|
|
@@ -3320,7 +3300,7 @@ typedef struct {
|
|
|
3320
3300
|
PyObject *__pyx_n_s_cchecksum;
|
|
3321
3301
|
PyObject *__pyx_n_s_cchecksum__checksum;
|
|
3322
3302
|
PyObject *__pyx_kp_s_cchecksum__checksum_pyx;
|
|
3323
|
-
PyObject *
|
|
3303
|
+
PyObject *__pyx_kp_u_cchecksum_line_4;
|
|
3324
3304
|
PyObject *__pyx_n_s_class;
|
|
3325
3305
|
PyObject *__pyx_n_s_class_getitem;
|
|
3326
3306
|
PyObject *__pyx_n_s_cline_in_traceback;
|
|
@@ -3527,7 +3507,7 @@ static int __pyx_m_clear(PyObject *m) {
|
|
|
3527
3507
|
Py_CLEAR(clear_module_state->__pyx_n_s_cchecksum);
|
|
3528
3508
|
Py_CLEAR(clear_module_state->__pyx_n_s_cchecksum__checksum);
|
|
3529
3509
|
Py_CLEAR(clear_module_state->__pyx_kp_s_cchecksum__checksum_pyx);
|
|
3530
|
-
Py_CLEAR(clear_module_state->
|
|
3510
|
+
Py_CLEAR(clear_module_state->__pyx_kp_u_cchecksum_line_4);
|
|
3531
3511
|
Py_CLEAR(clear_module_state->__pyx_n_s_class);
|
|
3532
3512
|
Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
|
|
3533
3513
|
Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
|
|
@@ -3712,7 +3692,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
|
3712
3692
|
Py_VISIT(traverse_module_state->__pyx_n_s_cchecksum);
|
|
3713
3693
|
Py_VISIT(traverse_module_state->__pyx_n_s_cchecksum__checksum);
|
|
3714
3694
|
Py_VISIT(traverse_module_state->__pyx_kp_s_cchecksum__checksum_pyx);
|
|
3715
|
-
Py_VISIT(traverse_module_state->
|
|
3695
|
+
Py_VISIT(traverse_module_state->__pyx_kp_u_cchecksum_line_4);
|
|
3716
3696
|
Py_VISIT(traverse_module_state->__pyx_n_s_class);
|
|
3717
3697
|
Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
|
|
3718
3698
|
Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
|
|
@@ -3907,7 +3887,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
|
3907
3887
|
#define __pyx_n_s_cchecksum __pyx_mstate_global->__pyx_n_s_cchecksum
|
|
3908
3888
|
#define __pyx_n_s_cchecksum__checksum __pyx_mstate_global->__pyx_n_s_cchecksum__checksum
|
|
3909
3889
|
#define __pyx_kp_s_cchecksum__checksum_pyx __pyx_mstate_global->__pyx_kp_s_cchecksum__checksum_pyx
|
|
3910
|
-
#define
|
|
3890
|
+
#define __pyx_kp_u_cchecksum_line_4 __pyx_mstate_global->__pyx_kp_u_cchecksum_line_4
|
|
3911
3891
|
#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
|
|
3912
3892
|
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
|
|
3913
3893
|
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
|
|
@@ -17999,8 +17979,8 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
|
|
|
17999
17979
|
return __pyx_r;
|
|
18000
17980
|
}
|
|
18001
17981
|
|
|
18002
|
-
/* "cchecksum/_checksum.pyx":
|
|
18003
|
-
* # cython:
|
|
17982
|
+
/* "cchecksum/_checksum.pyx":4
|
|
17983
|
+
* # cython: wraparound=False
|
|
18004
17984
|
*
|
|
18005
17985
|
* def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
18006
17986
|
* """
|
|
@@ -18064,7 +18044,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18064
18044
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
|
18065
18045
|
kw_args--;
|
|
18066
18046
|
}
|
|
18067
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
|
18047
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18068
18048
|
else goto __pyx_L5_argtuple_error;
|
|
18069
18049
|
CYTHON_FALLTHROUGH;
|
|
18070
18050
|
case 1:
|
|
@@ -18072,14 +18052,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18072
18052
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
|
|
18073
18053
|
kw_args--;
|
|
18074
18054
|
}
|
|
18075
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
|
18055
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18076
18056
|
else {
|
|
18077
|
-
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, 1); __PYX_ERR(0,
|
|
18057
|
+
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, 1); __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18078
18058
|
}
|
|
18079
18059
|
}
|
|
18080
18060
|
if (unlikely(kw_args > 0)) {
|
|
18081
18061
|
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
18082
|
-
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cchecksum") < 0)) __PYX_ERR(0,
|
|
18062
|
+
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cchecksum") < 0)) __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18083
18063
|
}
|
|
18084
18064
|
} else if (unlikely(__pyx_nargs != 2)) {
|
|
18085
18065
|
goto __pyx_L5_argtuple_error;
|
|
@@ -18088,11 +18068,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18088
18068
|
values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
|
|
18089
18069
|
}
|
|
18090
18070
|
__pyx_v_norm_address_no_0x = ((PyObject*)values[0]);
|
|
18091
|
-
__pyx_v_address_hash_hex_no_0x = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char__const__(values[1], 0); if (unlikely(!__pyx_v_address_hash_hex_no_0x.memview)) __PYX_ERR(0,
|
|
18071
|
+
__pyx_v_address_hash_hex_no_0x = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char__const__(values[1], 0); if (unlikely(!__pyx_v_address_hash_hex_no_0x.memview)) __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18092
18072
|
}
|
|
18093
18073
|
goto __pyx_L6_skip;
|
|
18094
18074
|
__pyx_L5_argtuple_error:;
|
|
18095
|
-
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0,
|
|
18075
|
+
__Pyx_RaiseArgtupleInvalid("cchecksum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4, __pyx_L3_error)
|
|
18096
18076
|
__pyx_L6_skip:;
|
|
18097
18077
|
goto __pyx_L4_argument_unpacking_done;
|
|
18098
18078
|
__pyx_L3_error:;
|
|
@@ -18107,7 +18087,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
|
18107
18087
|
__Pyx_RefNannyFinishContext();
|
|
18108
18088
|
return NULL;
|
|
18109
18089
|
__pyx_L4_argument_unpacking_done:;
|
|
18110
|
-
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_norm_address_no_0x), (&PyUnicode_Type), 1, "norm_address_no_0x", 1))) __PYX_ERR(0,
|
|
18090
|
+
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_norm_address_no_0x), (&PyUnicode_Type), 1, "norm_address_no_0x", 1))) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
18111
18091
|
__pyx_r = __pyx_pf_9cchecksum_9_checksum_cchecksum(__pyx_self, __pyx_v_norm_address_no_0x, __pyx_v_address_hash_hex_no_0x);
|
|
18112
18092
|
|
|
18113
18093
|
/* function exit code */
|
|
@@ -18147,82 +18127,80 @@ static PyObject *__pyx_pf_9cchecksum_9_checksum_cchecksum(CYTHON_UNUSED PyObject
|
|
|
18147
18127
|
int __pyx_clineno = 0;
|
|
18148
18128
|
__Pyx_TraceFrameInit(__pyx_codeobj__9)
|
|
18149
18129
|
__Pyx_RefNannySetupContext("cchecksum", 1);
|
|
18150
|
-
__Pyx_TraceCall("cchecksum", __pyx_f[0],
|
|
18130
|
+
__Pyx_TraceCall("cchecksum", __pyx_f[0], 4, 0, __PYX_ERR(0, 4, __pyx_L1_error));
|
|
18151
18131
|
|
|
18152
|
-
/* "cchecksum/_checksum.pyx":
|
|
18132
|
+
/* "cchecksum/_checksum.pyx":31
|
|
18153
18133
|
*
|
|
18154
18134
|
* # Declare memoryviews for fixed-length data
|
|
18155
18135
|
* cdef const unsigned char[::1] norm_address_mv = norm_address_no_0x.encode('ascii') # <<<<<<<<<<<<<<
|
|
18156
18136
|
*
|
|
18157
18137
|
* # Create a buffer for our result
|
|
18158
18138
|
*/
|
|
18159
|
-
__Pyx_TraceLine(
|
|
18139
|
+
__Pyx_TraceLine(31,0,__PYX_ERR(0, 31, __pyx_L1_error))
|
|
18160
18140
|
if (unlikely(__pyx_v_norm_address_no_0x == Py_None)) {
|
|
18161
18141
|
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
|
|
18162
|
-
__PYX_ERR(0,
|
|
18142
|
+
__PYX_ERR(0, 31, __pyx_L1_error)
|
|
18163
18143
|
}
|
|
18164
|
-
__pyx_t_1 = PyUnicode_AsASCIIString(__pyx_v_norm_address_no_0x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18144
|
+
__pyx_t_1 = PyUnicode_AsASCIIString(__pyx_v_norm_address_no_0x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
|
|
18165
18145
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18166
|
-
__pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0,
|
|
18146
|
+
__pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 31, __pyx_L1_error)
|
|
18167
18147
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18168
18148
|
__pyx_v_norm_address_mv = __pyx_t_2;
|
|
18169
18149
|
__pyx_t_2.memview = NULL;
|
|
18170
18150
|
__pyx_t_2.data = NULL;
|
|
18171
18151
|
|
|
18172
|
-
/* "cchecksum/_checksum.pyx":
|
|
18152
|
+
/* "cchecksum/_checksum.pyx":35
|
|
18173
18153
|
* # Create a buffer for our result
|
|
18174
18154
|
* # 2 for "0x" prefix and 40 for the address itself
|
|
18175
18155
|
* cdef unsigned char[42] buffer = b'0x' + bytearray(40) # <<<<<<<<<<<<<<
|
|
18176
18156
|
*
|
|
18177
18157
|
* # Handle character casing based on the hash value
|
|
18178
18158
|
*/
|
|
18179
|
-
__Pyx_TraceLine(
|
|
18180
|
-
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0,
|
|
18159
|
+
__Pyx_TraceLine(35,0,__PYX_ERR(0, 35, __pyx_L1_error))
|
|
18160
|
+
__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)
|
|
18181
18161
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18182
|
-
__pyx_t_3 = PyNumber_Add(__pyx_kp_b_0x, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0,
|
|
18162
|
+
__pyx_t_3 = PyNumber_Add(__pyx_kp_b_0x, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
18183
18163
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18184
18164
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18185
|
-
if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_t_3, __pyx_t_4, 42) < 0))) __PYX_ERR(0,
|
|
18165
|
+
if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_t_3, __pyx_t_4, 42) < 0))) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
18186
18166
|
memcpy(&(__pyx_v_buffer[0]), __pyx_t_4, sizeof(__pyx_v_buffer[0]) * (42));
|
|
18187
18167
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18188
18168
|
|
|
18189
|
-
/* "cchecksum/_checksum.pyx":
|
|
18169
|
+
/* "cchecksum/_checksum.pyx":41
|
|
18190
18170
|
* cdef int address_char
|
|
18191
18171
|
*
|
|
18192
18172
|
* for i in range(40): # <<<<<<<<<<<<<<
|
|
18193
18173
|
*
|
|
18194
18174
|
* if address_hash_hex_no_0x[i] < 56:
|
|
18195
18175
|
*/
|
|
18196
|
-
__Pyx_TraceLine(
|
|
18176
|
+
__Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
|
|
18197
18177
|
for (__pyx_t_5 = 0; __pyx_t_5 < 40; __pyx_t_5+=1) {
|
|
18198
18178
|
__pyx_v_i = __pyx_t_5;
|
|
18199
18179
|
|
|
18200
|
-
/* "cchecksum/_checksum.pyx":
|
|
18180
|
+
/* "cchecksum/_checksum.pyx":43
|
|
18201
18181
|
* for i in range(40):
|
|
18202
18182
|
*
|
|
18203
18183
|
* if address_hash_hex_no_0x[i] < 56: # <<<<<<<<<<<<<<
|
|
18204
18184
|
* # '0' to '7' have ASCII values 48 to 55
|
|
18205
18185
|
* buffer[i + 2] = norm_address_mv[i]
|
|
18206
18186
|
*/
|
|
18207
|
-
__Pyx_TraceLine(
|
|
18187
|
+
__Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error))
|
|
18208
18188
|
__pyx_t_6 = __pyx_v_i;
|
|
18209
|
-
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_address_hash_hex_no_0x.shape[0];
|
|
18210
18189
|
__pyx_t_7 = ((*((unsigned char const *) ( /* dim=0 */ ((char *) (((unsigned char const *) __pyx_v_address_hash_hex_no_0x.data) + __pyx_t_6)) ))) < 56);
|
|
18211
18190
|
if (__pyx_t_7) {
|
|
18212
18191
|
|
|
18213
|
-
/* "cchecksum/_checksum.pyx":
|
|
18192
|
+
/* "cchecksum/_checksum.pyx":45
|
|
18214
18193
|
* if address_hash_hex_no_0x[i] < 56:
|
|
18215
18194
|
* # '0' to '7' have ASCII values 48 to 55
|
|
18216
18195
|
* buffer[i + 2] = norm_address_mv[i] # <<<<<<<<<<<<<<
|
|
18217
18196
|
*
|
|
18218
18197
|
* else:
|
|
18219
18198
|
*/
|
|
18220
|
-
__Pyx_TraceLine(
|
|
18199
|
+
__Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error))
|
|
18221
18200
|
__pyx_t_6 = __pyx_v_i;
|
|
18222
|
-
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_norm_address_mv.shape[0];
|
|
18223
18201
|
(__pyx_v_buffer[(__pyx_v_i + 2)]) = (*((unsigned char const *) ( /* dim=0 */ ((char *) (((unsigned char const *) __pyx_v_norm_address_mv.data) + __pyx_t_6)) )));
|
|
18224
18202
|
|
|
18225
|
-
/* "cchecksum/_checksum.pyx":
|
|
18203
|
+
/* "cchecksum/_checksum.pyx":43
|
|
18226
18204
|
* for i in range(40):
|
|
18227
18205
|
*
|
|
18228
18206
|
* if address_hash_hex_no_0x[i] < 56: # <<<<<<<<<<<<<<
|
|
@@ -18232,27 +18210,26 @@ static PyObject *__pyx_pf_9cchecksum_9_checksum_cchecksum(CYTHON_UNUSED PyObject
|
|
|
18232
18210
|
goto __pyx_L5;
|
|
18233
18211
|
}
|
|
18234
18212
|
|
|
18235
|
-
/* "cchecksum/_checksum.pyx":
|
|
18213
|
+
/* "cchecksum/_checksum.pyx":48
|
|
18236
18214
|
*
|
|
18237
18215
|
* else:
|
|
18238
18216
|
* address_char = norm_address_mv[i] # <<<<<<<<<<<<<<
|
|
18239
18217
|
* # This checks if `address_char` falls in the ASCII range for lowercase hexadecimal
|
|
18240
18218
|
* # characters ('a' to 'f'), which correspond to ASCII values 97 to 102. If it does,
|
|
18241
18219
|
*/
|
|
18242
|
-
__Pyx_TraceLine(
|
|
18220
|
+
__Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error))
|
|
18243
18221
|
/*else*/ {
|
|
18244
18222
|
__pyx_t_6 = __pyx_v_i;
|
|
18245
|
-
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_norm_address_mv.shape[0];
|
|
18246
18223
|
__pyx_v_address_char = (*((unsigned char const *) ( /* dim=0 */ ((char *) (((unsigned char const *) __pyx_v_norm_address_mv.data) + __pyx_t_6)) )));
|
|
18247
18224
|
|
|
18248
|
-
/* "cchecksum/_checksum.pyx":
|
|
18225
|
+
/* "cchecksum/_checksum.pyx":52
|
|
18249
18226
|
* # characters ('a' to 'f'), which correspond to ASCII values 97 to 102. If it does,
|
|
18250
18227
|
* # the character is capitalized.
|
|
18251
18228
|
* buffer[i + 2] = address_char - 32 if 97 <= address_char <= 102 else address_char # <<<<<<<<<<<<<<
|
|
18252
18229
|
*
|
|
18253
18230
|
* # NOTE: For some reason on some systems the buffer length is longer than 42 here, even though that should not be possible.
|
|
18254
18231
|
*/
|
|
18255
|
-
__Pyx_TraceLine(
|
|
18232
|
+
__Pyx_TraceLine(52,0,__PYX_ERR(0, 52, __pyx_L1_error))
|
|
18256
18233
|
__pyx_t_7 = (97 <= __pyx_v_address_char);
|
|
18257
18234
|
if (__pyx_t_7) {
|
|
18258
18235
|
__pyx_t_7 = (__pyx_v_address_char <= 0x66);
|
|
@@ -18267,27 +18244,21 @@ static PyObject *__pyx_pf_9cchecksum_9_checksum_cchecksum(CYTHON_UNUSED PyObject
|
|
|
18267
18244
|
__pyx_L5:;
|
|
18268
18245
|
}
|
|
18269
18246
|
|
|
18270
|
-
/* "cchecksum/_checksum.pyx":
|
|
18247
|
+
/* "cchecksum/_checksum.pyx":56
|
|
18271
18248
|
* # NOTE: For some reason on some systems the buffer length is longer than 42 here, even though that should not be possible.
|
|
18272
18249
|
* # Lucky for us, the first 42 characters are always correct. One day maybe I'll debug this.
|
|
18273
|
-
* return
|
|
18250
|
+
* return buffer[:42].decode('ascii') # <<<<<<<<<<<<<<
|
|
18274
18251
|
*/
|
|
18275
|
-
__Pyx_TraceLine(
|
|
18252
|
+
__Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error))
|
|
18276
18253
|
__Pyx_XDECREF(__pyx_r);
|
|
18277
|
-
__pyx_t_3 =
|
|
18278
|
-
__Pyx_GOTREF(__pyx_t_3);
|
|
18279
|
-
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
18280
|
-
__Pyx_GOTREF(__pyx_t_1);
|
|
18281
|
-
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18282
|
-
__pyx_t_3 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
18254
|
+
__pyx_t_3 = __Pyx_decode_c_string(((char const *)__pyx_v_buffer), 0, 42, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
|
|
18283
18255
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18284
|
-
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18285
18256
|
__pyx_r = ((PyObject*)__pyx_t_3);
|
|
18286
18257
|
__pyx_t_3 = 0;
|
|
18287
18258
|
goto __pyx_L0;
|
|
18288
18259
|
|
|
18289
|
-
/* "cchecksum/_checksum.pyx":
|
|
18290
|
-
* # cython:
|
|
18260
|
+
/* "cchecksum/_checksum.pyx":4
|
|
18261
|
+
* # cython: wraparound=False
|
|
18291
18262
|
*
|
|
18292
18263
|
* def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
18293
18264
|
* """
|
|
@@ -19335,7 +19306,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
|
19335
19306
|
{&__pyx_n_s_cchecksum, __pyx_k_cchecksum, sizeof(__pyx_k_cchecksum), 0, 0, 1, 1},
|
|
19336
19307
|
{&__pyx_n_s_cchecksum__checksum, __pyx_k_cchecksum__checksum, sizeof(__pyx_k_cchecksum__checksum), 0, 0, 1, 1},
|
|
19337
19308
|
{&__pyx_kp_s_cchecksum__checksum_pyx, __pyx_k_cchecksum__checksum_pyx, sizeof(__pyx_k_cchecksum__checksum_pyx), 0, 0, 1, 0},
|
|
19338
|
-
{&
|
|
19309
|
+
{&__pyx_kp_u_cchecksum_line_4, __pyx_k_cchecksum_line_4, sizeof(__pyx_k_cchecksum_line_4), 0, 1, 0, 0},
|
|
19339
19310
|
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
|
|
19340
19311
|
{&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
|
|
19341
19312
|
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
|
|
@@ -19421,7 +19392,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
|
19421
19392
|
}
|
|
19422
19393
|
/* #### Code section: cached_builtins ### */
|
|
19423
19394
|
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
|
19424
|
-
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0,
|
|
19395
|
+
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 41, __pyx_L1_error)
|
|
19425
19396
|
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 83, __pyx_L1_error)
|
|
19426
19397
|
__pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 83, __pyx_L1_error)
|
|
19427
19398
|
__pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 86, __pyx_L1_error)
|
|
@@ -19478,14 +19449,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
19478
19449
|
__Pyx_GOTREF(__pyx_tuple__8);
|
|
19479
19450
|
__Pyx_GIVEREF(__pyx_tuple__8);
|
|
19480
19451
|
|
|
19481
|
-
/* "cchecksum/_checksum.pyx":
|
|
19452
|
+
/* "cchecksum/_checksum.pyx":35
|
|
19482
19453
|
* # Create a buffer for our result
|
|
19483
19454
|
* # 2 for "0x" prefix and 40 for the address itself
|
|
19484
19455
|
* cdef unsigned char[42] buffer = b'0x' + bytearray(40) # <<<<<<<<<<<<<<
|
|
19485
19456
|
*
|
|
19486
19457
|
* # Handle character casing based on the hash value
|
|
19487
19458
|
*/
|
|
19488
|
-
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_40); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0,
|
|
19459
|
+
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_40); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 35, __pyx_L1_error)
|
|
19489
19460
|
__Pyx_GOTREF(__pyx_tuple__10);
|
|
19490
19461
|
__Pyx_GIVEREF(__pyx_tuple__10);
|
|
19491
19462
|
|
|
@@ -19590,17 +19561,17 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
19590
19561
|
__Pyx_GIVEREF(__pyx_tuple__20);
|
|
19591
19562
|
__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)
|
|
19592
19563
|
|
|
19593
|
-
/* "cchecksum/_checksum.pyx":
|
|
19594
|
-
* # cython:
|
|
19564
|
+
/* "cchecksum/_checksum.pyx":4
|
|
19565
|
+
* # cython: wraparound=False
|
|
19595
19566
|
*
|
|
19596
19567
|
* def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
19597
19568
|
* """
|
|
19598
19569
|
* Computes the checksummed version of an Ethereum address.
|
|
19599
19570
|
*/
|
|
19600
|
-
__pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_norm_address_no_0x, __pyx_n_s_address_hash_hex_no_0x, __pyx_n_s_norm_address_mv, __pyx_n_s_buffer, __pyx_n_s_i, __pyx_n_s_address_char); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0,
|
|
19571
|
+
__pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_norm_address_no_0x, __pyx_n_s_address_hash_hex_no_0x, __pyx_n_s_norm_address_mv, __pyx_n_s_buffer, __pyx_n_s_i, __pyx_n_s_address_char); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
19601
19572
|
__Pyx_GOTREF(__pyx_tuple__22);
|
|
19602
19573
|
__Pyx_GIVEREF(__pyx_tuple__22);
|
|
19603
|
-
__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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,
|
|
19574
|
+
__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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, 4, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
19604
19575
|
__Pyx_RefNannyFinishContext();
|
|
19605
19576
|
return 0;
|
|
19606
19577
|
__pyx_L1_error:;
|
|
@@ -20664,33 +20635,33 @@ if (!__Pyx_RefNanny) {
|
|
|
20664
20635
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
20665
20636
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
20666
20637
|
|
|
20667
|
-
/* "cchecksum/_checksum.pyx":
|
|
20668
|
-
* # cython:
|
|
20638
|
+
/* "cchecksum/_checksum.pyx":4
|
|
20639
|
+
* # cython: wraparound=False
|
|
20669
20640
|
*
|
|
20670
20641
|
* def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str: # <<<<<<<<<<<<<<
|
|
20671
20642
|
* """
|
|
20672
20643
|
* Computes the checksummed version of an Ethereum address.
|
|
20673
20644
|
*/
|
|
20674
|
-
__Pyx_TraceLine(
|
|
20675
|
-
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0,
|
|
20645
|
+
__Pyx_TraceLine(4,0,__PYX_ERR(0, 4, __pyx_L1_error))
|
|
20646
|
+
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
20676
20647
|
__Pyx_GOTREF(__pyx_t_7);
|
|
20677
|
-
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0,
|
|
20678
|
-
__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,
|
|
20648
|
+
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
20649
|
+
__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, 4, __pyx_L1_error)
|
|
20679
20650
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20680
20651
|
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
|
|
20681
20652
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
20682
|
-
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cchecksum, __pyx_t_4) < 0) __PYX_ERR(0,
|
|
20653
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cchecksum, __pyx_t_4) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
|
|
20683
20654
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
20684
20655
|
|
|
20685
20656
|
/* "cchecksum/_checksum.pyx":1
|
|
20686
20657
|
* # cython: boundscheck=False # <<<<<<<<<<<<<<
|
|
20658
|
+
* # cython: wraparound=False
|
|
20687
20659
|
*
|
|
20688
|
-
* def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str:
|
|
20689
20660
|
*/
|
|
20690
20661
|
__Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
|
|
20691
20662
|
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20692
20663
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20693
|
-
if (PyDict_SetItem(__pyx_t_4,
|
|
20664
|
+
if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_cchecksum_line_4, __pyx_kp_u_Computes_the_checksummed_versio) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20694
20665
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
20695
20666
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
20696
20667
|
__Pyx_TraceReturn(Py_None, 0);
|
|
@@ -23269,12 +23240,20 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
|
|
|
23269
23240
|
}
|
|
23270
23241
|
}
|
|
23271
23242
|
|
|
23272
|
-
/*
|
|
23273
|
-
static CYTHON_INLINE PyObject*
|
|
23274
|
-
const char* cstring, Py_ssize_t
|
|
23243
|
+
/* decode_c_string */
|
|
23244
|
+
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
|
|
23245
|
+
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
|
|
23275
23246
|
const char* encoding, const char* errors,
|
|
23276
23247
|
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
|
|
23248
|
+
Py_ssize_t length;
|
|
23277
23249
|
if (unlikely((start < 0) | (stop < 0))) {
|
|
23250
|
+
size_t slen = strlen(cstring);
|
|
23251
|
+
if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
|
|
23252
|
+
PyErr_SetString(PyExc_OverflowError,
|
|
23253
|
+
"c-string too long to convert to Python");
|
|
23254
|
+
return NULL;
|
|
23255
|
+
}
|
|
23256
|
+
length = (Py_ssize_t) slen;
|
|
23278
23257
|
if (start < 0) {
|
|
23279
23258
|
start += length;
|
|
23280
23259
|
if (start < 0)
|
|
@@ -23283,8 +23262,6 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
|
|
|
23283
23262
|
if (stop < 0)
|
|
23284
23263
|
stop += length;
|
|
23285
23264
|
}
|
|
23286
|
-
if (stop > length)
|
|
23287
|
-
stop = length;
|
|
23288
23265
|
if (unlikely(stop <= start))
|
|
23289
23266
|
return __Pyx_NewRef(__pyx_empty_unicode);
|
|
23290
23267
|
length = stop - start;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# cython: boundscheck=False
|
|
2
|
+
# cython: wraparound=False
|
|
2
3
|
|
|
3
4
|
def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_no_0x) -> str:
|
|
4
5
|
"""
|
|
@@ -52,4 +53,4 @@ def cchecksum(str norm_address_no_0x, const unsigned char[::1] address_hash_hex_
|
|
|
52
53
|
|
|
53
54
|
# NOTE: For some reason on some systems the buffer length is longer than 42 here, even though that should not be possible.
|
|
54
55
|
# Lucky for us, the first 42 characters are always correct. One day maybe I'll debug this.
|
|
55
|
-
return
|
|
56
|
+
return buffer[:42].decode('ascii')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cchecksum
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
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
|
|
@@ -36,6 +36,7 @@ exclude_patterns = [
|
|
|
36
36
|
# Looks for objects in documentation of external libraries
|
|
37
37
|
intersphinx_mapping = {
|
|
38
38
|
"eth_typing": ("https://eth-typing.readthedocs.io/en/stable/", None),
|
|
39
|
+
"eth_utils": ("https://eth-utils.readthedocs.io/en/stable/", None),
|
|
39
40
|
"python": ("https://docs.python.org/3", None),
|
|
40
41
|
}
|
|
41
42
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|