Nano ID

build pub

Dart implementation of ai/nanoid

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

Libraries

generate
generate
generate
nanoid
nanoid
nanoid
url