C++ · Keys

Keys

3.0.0-rc.1 · cabb6603

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/usearch/cpp/keys.md' | claude -p "How would this fit my code?"

A key is usearch_key_t, a 128-bit identity of sixteen bytes. Integer identities park in the low eight bytes, big-endian, so a key whose last byte is 42 prints as 00000000-0000-0000-0000-00000000002a.

usearch_key_t key {};
key.bytes[15] = 42;
std::span<usearch_key_t const> const keys {stored_keys}; // a std::vector, a C array or a std::array

Keys need not be unique: an index admits up to values_per_key entries under one, count reports how many it holds, and get returns them all. The all-zero key is the nil key.