nanoid_generator 1.0.2
nanoid_generator: ^1.0.2 copied to clipboard
A secure, URL-friendly, unique string ID generator for Dart. Generate cryptographically secure, collision-resistant IDs with customizable size and alphabet using Random.secure().
1.0.2 - 2026-02-01 #
1.0.0 - 2026-01-10 #
0.0.1 - 2026-01-09 #
Added #
- Initial release of NanoID Generator for Dart and Flutter
nanoid()function for generating cryptographically secure, URL-friendly unique IDs- Default 21-character length with URL-safe alphabet (A-Za-z0-9_-)
- Customizable size parameter
- Customizable alphabet parameter
customAlphabet()function for creating reusable ID generators with fixed alphabets- Support for custom default size
- Returns closure for efficient repeated generation
- Cryptographically secure random generation using
Random.secure() - Unbiased algorithm that avoids modulo bias for uniform distribution
- Comprehensive input validation with clear error messages
- Full API documentation with dartdoc comments
- Comprehensive test suite with 40+ tests covering:
- Default generation behavior
- Custom sizes and alphabets
- Edge cases and error handling
- Collision resistance (10,000 unique IDs)
- URL-safety validation
- Performance benchmarks
- Complete README with usage examples and API reference