mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-30 13:24:19 +00:00
Expose reset as well
This commit is contained in:
parent
fabb6bd8cc
commit
562f09c1f6
2 changed files with 24 additions and 0 deletions
|
|
@ -175,6 +175,12 @@ Hasher_dealloc(PyObject *self) {
|
|||
Py_TYPE(self)->tp_free(self);
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
reset(Hasher *self) {
|
||||
if (!self->h.reset(self->h.state)) return PyErr_NoMemory();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
update(Hasher *self, PyObject *o) {
|
||||
FREE_BUFFER_AFTER_FUNCTION Py_buffer data = {0};
|
||||
|
|
@ -217,6 +223,7 @@ static PyMethodDef Hasher_methods[] = {
|
|||
METHODB(update, METH_O),
|
||||
METHODB(digest, METH_NOARGS),
|
||||
METHODB(hexdigest, METH_NOARGS),
|
||||
METHODB(reset, METH_NOARGS),
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue