blob: 665c8317b1242547ace557495eab5b2581b7db68 [file] [log] [blame]
Serhiy Storchaka1009bf12015-04-03 23:53:51 +03001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(MD5Type_copy__doc__,
6"copy($self, /)\n"
7"--\n"
8"\n"
9"Return a copy of the hash object.");
10
11#define MD5TYPE_COPY_METHODDEF \
12 {"copy", (PyCFunction)MD5Type_copy, METH_NOARGS, MD5Type_copy__doc__},
13
14static PyObject *
15MD5Type_copy_impl(MD5object *self);
16
17static PyObject *
18MD5Type_copy(MD5object *self, PyObject *Py_UNUSED(ignored))
19{
20 return MD5Type_copy_impl(self);
21}
22
23PyDoc_STRVAR(MD5Type_digest__doc__,
24"digest($self, /)\n"
25"--\n"
26"\n"
27"Return the digest value as a string of binary data.");
28
29#define MD5TYPE_DIGEST_METHODDEF \
30 {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__},
31
32static PyObject *
33MD5Type_digest_impl(MD5object *self);
34
35static PyObject *
36MD5Type_digest(MD5object *self, PyObject *Py_UNUSED(ignored))
37{
38 return MD5Type_digest_impl(self);
39}
40
41PyDoc_STRVAR(MD5Type_hexdigest__doc__,
42"hexdigest($self, /)\n"
43"--\n"
44"\n"
45"Return the digest value as a string of hexadecimal digits.");
46
47#define MD5TYPE_HEXDIGEST_METHODDEF \
48 {"hexdigest", (PyCFunction)MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__},
49
50static PyObject *
51MD5Type_hexdigest_impl(MD5object *self);
52
53static PyObject *
54MD5Type_hexdigest(MD5object *self, PyObject *Py_UNUSED(ignored))
55{
56 return MD5Type_hexdigest_impl(self);
57}
58
59PyDoc_STRVAR(MD5Type_update__doc__,
60"update($self, obj, /)\n"
61"--\n"
62"\n"
63"Update this hash object\'s state with the provided string.");
64
65#define MD5TYPE_UPDATE_METHODDEF \
66 {"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__},
67
68PyDoc_STRVAR(_md5_md5__doc__,
69"md5($module, /, string=b\'\')\n"
70"--\n"
71"\n"
72"Return a new MD5 hash object; optionally initialized with a string.");
73
74#define _MD5_MD5_METHODDEF \
75 {"md5", (PyCFunction)_md5_md5, METH_VARARGS|METH_KEYWORDS, _md5_md5__doc__},
76
77static PyObject *
78_md5_md5_impl(PyModuleDef *module, PyObject *string);
79
80static PyObject *
81_md5_md5(PyModuleDef *module, PyObject *args, PyObject *kwargs)
82{
83 PyObject *return_value = NULL;
84 static char *_keywords[] = {"string", NULL};
85 PyObject *string = NULL;
86
87 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
88 "|O:md5", _keywords,
89 &string))
90 goto exit;
91 return_value = _md5_md5_impl(module, string);
92
93exit:
94 return return_value;
95}
96/*[clinic end generated code: output=f72618edfd35d984 input=a9049054013a1b77]*/