pysss_murmur.c revision 341a00311680a440d7f979f06c34c70d86c9367a
/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2012 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Python.h>
#include "util/sss_python.h"
#include "util/murmurhash3.h"
"murmurhash3(key, key_len, seed) -> 32bit integer hash\n\
\n\
Calculate the murmur hash version 3 of the first key_len bytes from key\n\
using the given seed."
);
{
const char *key;
long key_len;
long long seed;
return NULL;
}
return NULL;
}
return PyLong_FromUnsignedLong((unsigned long) hash);
}
static PyMethodDef methods[] = {
};
#ifdef IS_PY3K
static struct PyModuleDef pysss_murmurdef = {
"pysss_murmur",
NULL,
-1,
NULL,
NULL,
NULL,
};
PyInit_pysss_murmur(void)
#else
initpysss_murmur(void)
#endif
{
PyObject *m;
#ifdef IS_PY3K
m = PyModule_Create(&pysss_murmurdef);
#else
#endif
if (m == NULL)
#ifdef IS_PY3K
return m;
#endif
}