};
PyMODINIT_FUNC
-inithashtext(void)
+init_chashtext(void)
{
PyObject *module;
- module = Py_InitModule("hashtext", methods);
+ module = Py_InitModule("_chashtext", methods);
PyModule_AddStringConstant(module, "__doc__", "String hash functions");
}
# skytools.utf8
'safe_utf8_decode': 'skytools.utf8:safe_utf8_decode',
# hashing
- 'hashtext_old': 'skytools.pyhashtext:hashtext_old',
- 'hashtext_new': 'skytools.pyhashtext:hashtext_new',
+ 'hashtext_old': 'skytools.hashtext:hashtext_old',
+ 'hashtext_new': 'skytools.hashtext:hashtext_new',
}
__all__ = _symbols.keys()
"""
Pure python implementation of Postgres hashes
->>> import skytools.hashtext
+>>> import skytools._chashtext
>>> for i in range(3):
... print [hashtext_new_py('x' * (i*5 + j)) for j in range(5)]
[-1477818771, 1074944137, -1086392228, -1992236649, -1379736791]
try:
- from skytools.hashtext import hashtext_old, hashtext_new
+ from skytools._chashtext import hashtext_old, hashtext_new
except ImportError:
hashtext_old = hashtext_old_py
hashtext_new = hashtext_new_py
if BUILD_C_MOD:
ext = [
Extension("skytools._cquoting", ['python/modules/cquoting.c']),
- Extension("skytools.hashtext", ['python/modules/hashtext.c']),
+ Extension("skytools._chashtext", ['python/modules/hashtext.c']),
]
c_modules.extend(ext)