diff --git a/include/wrapping_dap_hash.h b/include/wrapping_dap_hash.h index 1d80fab57ca7fa50b72383dc9d76995b98dce569..701b5cc4fa4aa5cedaf44a846210b1f858569fdf 100644 --- a/include/wrapping_dap_hash.h +++ b/include/wrapping_dap_hash.h @@ -77,6 +77,7 @@ PyObject *dap_hash_fast_py(PyObject *self, PyObject *args); PyObject *dap_hash_fast_compare_py(PyObject *self, PyObject *args); PyObject *dap_hash_fast_is_blank_py(PyObject *self, PyObject *args); PyObject *dap_chain_hash_fast_to_str_py(PyObject *self, PyObject *args); +PyObject *dap_chain_hash_fast_to_str_new_py(PyObject *self, PyObject *args); static PyMethodDef DapHashFastMethods[] = { {"strToHashFast", (PyCFunction)dap_chain_str_to_hash_fast_py, METH_VARARGS | METH_STATIC, ""}, @@ -84,6 +85,7 @@ static PyMethodDef DapHashFastMethods[] = { {"compare", (PyCFunction)dap_hash_fast_compare_py, METH_VARARGS | METH_STATIC, ""}, {"isBlank", (PyCFunction)dap_hash_fast_is_blank_py, METH_VARARGS, ""}, {"toStr", (PyCFunction)dap_chain_hash_fast_to_str_py, METH_VARARGS, ""}, + {"toStrNew", (PyCFunction)dap_chain_hash_fast_to_str_new_py, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; diff --git a/src/wrapping_dap_hash.c b/src/wrapping_dap_hash.c index 06d1227ea7c9b27a60d475801d82002e47a58efb..c54f6f43be72b41a9fa0dbebdf61e15b6e60c3e3 100644 --- a/src/wrapping_dap_hash.c +++ b/src/wrapping_dap_hash.c @@ -61,3 +61,8 @@ PyObject *dap_chain_hash_fast_to_str_py(PyObject *self, PyObject *args){ int res = dap_chain_hash_fast_to_str(((PyDapChainHashFastObject*)self)->hash_fast, str, str_max); return Py_BuildValue("sn", &str, &str_max); } + +PyObject *dap_chain_hash_fast_to_str_new_py(PyObject *self, PyObject *args){ + char *res = dap_chain_hash_fast_to_str_new(((PyDapChainHashFastObject*)self)->hash_fast); + return Py_BuildValue("s", res); +}