nanoid_plus 1.2.0 copy "nanoid_plus: ^1.2.0" to clipboard
nanoid_plus: ^1.2.0 copied to clipboard

A small, secure, and URL-safe ID generator for Dart.

example/nanoid_plus_example.dart

import 'package:nanoid_plus/nanoid_plus.dart';

void main() {
  final nanoID = NanoID();

  // Use A–Z, a–z, 0–9, '-', '_'
  final id1 = nanoID.urlSafe();

  // Use A–Z, a–z, 0–9, '-', '_', length=8
  final id2 = nanoID.urlSafe(length: 8);

  // Removes O, I, l, 0, 1
  final id3 = nanoID.urlSafeHumanFriendly();

  // Removes O, I, l, 0, 1, length=12
  final id4 = nanoID.urlSafeHumanFriendly(length: 12);

  // Use A, B, C, 1, 2, 3, length=10
  const customChars = 'ABC123';
  final id5 = nanoID.custom(length: 10, charSet: customChars);

  print(id1); // e.g. Axs0km54bhQzL9_YW1D0p
  print(id2); // e.g. Zk3_Pq1A
  print(id3); // e.g. fG5kH3MnPqR2
  print(id4); // e.g. jK7hV8vT3bN5
  print(id5); // e.g. A1B2C3A1B2
}
2
likes
0
points
319
downloads

Publisher

verified publisherrubydog.jp

Weekly Downloads

A small, secure, and URL-safe ID generator for Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on nanoid_plus