Skip to content
pubscout

uid

0.2.0, released 2 weeks ago by an unverified publisher

Generates timestamp‑based unique IDs and random barcodes with configurable length and charset.

WASM-ready
$ flutter pub add uid
Source repository

What it does

The package creates IDs by inserting a random string into the current timestamp at a random position. It also produces random barcode numbers (5‑13 characters) using numbers, capital letters, or both, with batch methods for both IDs and barcodes.

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

Use it when

  • You need quick, lightweight IDs without external dependencies
  • You need simple random barcode strings for testing or non‑secure labeling

Skip it when

  • Cryptographic‑level uniqueness is required
  • You need QR/barcode encoding or validation logic

Strengths

  • Fast and dependency‑free
  • Supports custom charset and length
  • Batch generation without duplicates

Weaknesses

  • No guarantees against collisions in high‑throughput scenarios
  • Limited to numeric or uppercase alphabetic characters
  • No built‑in validation or encoding for real barcodes

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:uid/uid.dart';

void main() {
  String id = UId.getId();
  String barcode = UId.getBarcode(length: 8, charset: BarcodeCharset.alphabet);
  print('ID: $id');
  print('Barcode: $barcode');
}

Alternatives

Packages that do the same job and could replace uid.

  • uuid

    Provides standard UUID formats with proven uniqueness guarantees