nanoid 0.1.0

Dart native js
Flutter Android iOS web

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

nanoid #

build pub

Dart implementation of ai/nanoid

Installation #

Add nanoid as a dependency in your pubspec.yaml file

Usage #

Normal #

import 'package:nanoid/nanoid.dart';

void main() {
  var id = nanoid();
  var custom_length_id = nanoid(10);
  // ...
}

Custom Alphabet or length #

import 'package:nanoid/generate.dart';

void main() {
  var id = generate('1234567890abcdef', 10);
  // ...
}

Async API #

import 'package:nanoid/async/nanoid.dart';

void main() async {
  var id = await nanoid();
  var custom_length_id = await nanoid(10);
  // ...
}
import 'package:nanoid/async/generate.dart';

void main() async {
  var id = await generate('1234567890abcdef', 10);
  // ...
}

Non-secure API #

import 'package:nanoid/non_secure/nanoid.dart';

void main() {
  var non_secure_id = nanoid();
  var custom_length_id = nanoid(10);
  // ...
}
import 'package:nanoid/non_secure/generate.dart';

void main() {
  var non_secure_id = generate('1234567890abcdef', 10);
  // ...
}

License #

MIT

7
likes
90
pub points
85%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

pd4d10@gmail.com

License

MIT (LICENSE)

More

Packages that depend on nanoid