nanoid 1.0.0 copy "nanoid: ^1.0.0" to clipboard
nanoid: ^1.0.0 copied to clipboard

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

nanoid #

pub test

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/nanoid.dart';

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

Async API #

import 'package:nanoid/async.dart';

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

Non-secure API #

import 'package:nanoid/non_secure.dart';

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

License #

MIT

121
likes
150
pub points
96%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on nanoid