+ me.k = k
+ def hash(me, object data):
+ return _unihash_hash(me, data)
+
+## DEPRECATED: compatibility hack
+Key = UnihashKey
+
+cdef const unihash_info *_unihash_keydata(UnihashKey key):
+ if key is None:
+ return &unihash_global
+ else:
+ return &key._i
+
+cdef uint32 _unihash_hash(UnihashKey key, object data):
+ cdef const void *p
+ cdef Py_ssize_t n
+ cdef const unihash_info *i = _unihash_keydata(key)
+ PyObject_AsReadBuffer(data, &p, &n)
+ return unihash_hash(i, UNIHASH_INIT(i), p, n)