xid
1.2.1, released 3 years ago by an unverified publisher
Generates compact, sortable, URL‑safe 20‑character IDs based on MongoDB ObjectID algorithm.
WASM-ready
What it does
Provides a Dart implementation of the Xid algorithm, creating 12‑byte (96‑bit) identifiers encoded in base32 hex. The IDs are k‑ordered, include a timestamp, and require no configuration or central server.
AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need short, sortable IDs without external services
- You want IDs that embed time and are URL‑safe
- You prefer a pure‑Dart solution that works on all platforms
Skip it when
- You need cryptographically secure random IDs
- You require UUID format or compatibility with existing UUID tooling
Strengths
- Very small string representation (20 chars)
- Sortable and time‑ordered
- No configuration or external dependencies
Weaknesses
- Not a standard UUID, may not interoperate with UUID‑only systems
- Only 1‑second timestamp precision
- Not cryptographically random
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:xid/xid.dart';
void main() {
var id = Xid();
print('generated id: $id');
}Alternatives
Packages that do the same job and could replace xid.