From: Michael Tremer Date: Sat, 1 Oct 2022 13:20:46 +0000 (+0000) Subject: _pakfire: Drop hexdigest() from File X-Git-Tag: 0.9.28~285 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c11990ad138cb9e25b83557446a9c52c9f618abb;p=pakfire.git _pakfire: Drop hexdigest() from File It is easy enough to convert from bytes to hex Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/file.c b/src/_pakfire/file.c index e8384b279..d0697bdb3 100644 --- a/src/_pakfire/file.c +++ b/src/_pakfire/file.c @@ -253,26 +253,6 @@ static PyObject* File_digest(FileObject* self, PyObject* args) { return PyBytes_FromStringAndSize((const char*)digest, length); } -static PyObject* _File_hexdigest(FileObject* self, enum pakfire_digest_types type) { - char* hexdigest = pakfire_file_get_hexdigest(self->file, type); - if (!hexdigest) - Py_RETURN_NONE; - - PyObject* obj = PyUnicode_FromString(hexdigest); - free(hexdigest); - - return obj; -} - -static PyObject* File_hexdigest(FileObject* self, PyObject* args) { - int type = 0; - - if (!PyArg_ParseTuple(args, "i", &type)) - return NULL; - - return _File_hexdigest(self, type); -} - static struct PyMethodDef File_methods[] = { { "digest", @@ -280,12 +260,6 @@ static struct PyMethodDef File_methods[] = { METH_VARARGS, NULL, }, - { - "hexdigest", - (PyCFunction)File_hexdigest, - METH_VARARGS, - NULL, - }, { NULL }, };