# Keys

> USearch for Java

A key is sixteen opaque bytes rendered as a lowercase dashed UUID, and integer identities park in the low eight bytes.
`Key.of(42)` therefore prints as `00000000-0000-0000-0000-00000000002a`, byte for byte the same rendering every other USearch SDK produces.
Keys need not be unique: several entries may share one, and `count` reports how many.

Those sixteen bytes are a `java.util.UUID`'s two big-endian longs, so `toUUID` and `fromUUID` convert without reordering anything.
`Key.parse` is the wider reader of the two: it takes thirty-two hexadecimal digits with dashes anywhere or nowhere, in either case, which is the spelling every USearch SDK writes and reads.
`Key` also orders its bytes unsigned, where `UUID.compareTo` reads the same two longs as signed.

```java
Key key = Key.of(42);
Key parsed = Key.parse("00000000-0000-0000-0000-00000000002a");
Key adopted = Key.fromUUID(UUID.randomUUID());
long identity = key.toLong();
```

`import cloud.unum.usearch.*;`

## Key

A 128-bit entry identity, most significant byte first, rendered as a lowercase dashed UUID.

```java
class Key
```

The sixteen bytes are a `UUID`'s two big-endian longs, so `toUUID()` and `fromUUID(UUID)` convert without reordering anything.

Keys need not be unique: several entries may share one, and `DenseVerbs#count(Key)` reports how many. Integer identities park in the low eight bytes, so Key.of(42) prints as 00000000-0000-0000-0000-00000000002a.

- `BYTES` `final int`: The width of a key in bytes, and the row pitch of every key matrix crossing the boundary.
- `NIL` `final Key`: The all-zero key.

