id_gen 0.2.1 copy "id_gen: ^0.2.1" to clipboard
id_gen: ^0.2.1 copied to clipboard

A standartized set of IDs generators.

ID Generators #

Cover - ID Generators

The standartized and well-tested set for generate identifiers.

Examples #

Generate 4 UUIDs #

About UUID (online generator): https://uuidgenerator.net

const gen = UuidGen();
for (var i = 0; i < 4; ++i) {
    print(gen.get());
}

Output:

490833da-4976-4563-8c8a-9f5464a2bf7e
e82e3bf5-c3ea-46d6-a835-12644b99cf6e
4d86c01f-777b-4599-b28f-c87c3737c8e2
60fc6015-417e-4548-adaa-b032b1f7dbcd

Generate HID from language #

Supported languages:

  • Belarusian
  • English
  • Ukrainian
const gen = HumanIdGen(options: HumanIdGenOptions(lowerCase: true));
final hid = gen.get('Тема статті чи назва курсу');
print(hid);

Output:

tema-stati-chy-nazva-kursu

Generate Transit Integer ID #

final id = TransitIdGen();
print(id.get());
// or
print(id.next);

Output:

1
2

License #

MIT

TODO #