Skip to content
pubscout

shortid

0.1.2, released 5 years ago by an unverified publisher

Generates short, non‑sequential, URL‑friendly unique strings.

WASM-readySingle maintainer
$ flutter pub add shortid
Source repository

What it does

It creates IDs composed of 7‑14 characters from a URL‑safe alphabet. The alphabet and seed can be customized, and the generator can produce many IDs without collisions.

AI-written summary of version 0.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need short, human‑readable identifiers for URLs, database keys, or temporary tokens
  • You want a lightweight, dependency‑free solution for generating non‑cryptographic IDs

Skip it when

  • You require cryptographically secure IDs
  • You need guaranteed global uniqueness across distributed systems

Strengths

  • Very short IDs suitable for URLs
  • Customizable alphabet and seed
  • Zero external dependencies

Weaknesses

  • Not cryptographically secure
  • Potential for collisions if used at massive scale without careful seeding

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:shortid/shortid.dart';

void main() {
  print(shortid.generate()); // e.g., PPBqWA9
}

Alternatives

Packages that do the same job and could replace shortid.

  • uuid

    Provides standard UUIDs with optional cryptographic security and wide ecosystem support