FLUTTER ECOSYSTEM

nanoid

A tiny, secure, URL-friendly, unique string ID generator. Dart implementation of ai/nanoid

nanoid cover
Latest version
1.0.0
30-day downloads
93.6K
Likes
125
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A lightweight, secure, and URL-friendly unique ID generator for Dart, inspired by the popular JavaScript library. It produces cryptographically strong, random strings that are safe for use in URLs, filenames, and database keys. The Dart implementation ensures cross-platform compatibility across Android, iOS, Web, macOS, Windows, and Linux. Designed for simplicity and performance, it avoids predictable patterns while maintaining minimal code size. Ideal for generating short, unique identifiers in applications requiring security and reliability.

Use cases
  • Generating unique IDs for database records
  • Creating secure tokens for authentication
  • Producing URL-safe identifiers for web routing
  • Using in distributed systems for collision-resistant keys
  • Building short, readable identifiers for user-facing content
Key features
  • Cryptographically secure random generation
  • URL-safe character set
  • Minimal code footprint
  • Cross-platform support
  • Customizable ID length
  • No external dependencies
Suitable for
  • Web and mobile app developers
  • Backend services needing unique keys
  • Applications requiring secure token generation
  • Projects prioritizing small bundle size
  • Developers using Flutter with security needs
Considerations
  • Not suitable for sequential or predictable ID requirements
  • Length must be balanced between uniqueness and readability
  • May require seeding for deterministic testing
  • Limited to string output format
  • Does not provide UUID or other ID standards
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add nanoid

Categories

Source repository

Related projects