PointIdHasher class

Deterministically maps an arbitrary user-supplied String ID to a qdrant-edge PointId::Uuid.

qdrant-edge stores points keyed by PointId, which is either a u64 integer or a UUID — arbitrary Strings are not accepted. flutter_gemma's public RAG API has always exposed String id (e.g. "doc_42", "section-3-paragraph-7"), so we need a stable surjection from String to UUID at the storage boundary.

We use UUIDv5 (RFC 4122) under a fixed namespace, which guarantees:

  • Determinism: same input String → same UUID, always, across processes and machines. Reopening a shard finds the same points.
  • No collisions in practice: the SHA-1 → 128-bit space makes accidental collisions astronomically unlikely for any realistic RAG corpus (~10^36 IDs before the birthday bound at 50%).
  • Forward compatibility: if a future release adds Qdrant Cloud sync, the same namespace produces matching IDs server-side.

The namespace UUID was chosen from RFC 4122 Appendix C (Namespace IDs for Naming Service Authorities) — it is the well-known "DNS namespace" constant used by the same approach in many other databases. We never change it; doing so would orphan all existing shards.

Constructors

PointIdHasher()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hash(String userId) String
Returns the UUIDv5 string for userId under the fixed namespace.
override