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

A standartized and well-tested set of IDs generators: globally unique, readable, time-dependency, transitive, incremental, decremental IDs.

ID Generators #

Cover - ID Generators

GitHub License Pub Package Code Size Publisher

Build Status Pull Requests Issues Pub Score

The standartized, easy-to-use and well-tested set for generate identifiers: globally unique, readable, time-dependency, transitive, incremental, decremental IDs. Feel free to use it in your awesome project.

Share some ❤️ and star repo to support the project.

Usage #

Generate 4 UUIDs #

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

for (var i = 0; i < 4; ++i) {
  print(genUuid);
}
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);
tema-stati-chy-nazva-kursu

Generate Transit Integer ID #

print(genTransitId);
// or
print(TransitId().next);
1
2

Generate Time Integer ID #

print(genTimeId);
// or
print(genTimeIdMicro);
1705954581187
1705954581188687

Note that second ID does not fit into 53 bits (the size of a IEEE double). A JavaScript number is not able to hold this value.

Add HID and UID to Any Class #

class Quant with HasStringIdMix {
  Quant({String? hid, String? uid}) {
    this.hid = hid;
    this.uid = uid;
  }
}

print(Quant().id);
print(Quant(hid: 'aerwyna').id);
92e6ee3e-537a-4dd3-b4e9-06b8fd366469
aerwyna

Welcome #

Requests and suggestions are warmly welcome.

This package is open-source, stable and well-tested. Development happens on GitHub. Feel free to report issues or create a pull-request there.

General questions are best asked on StackOverflow.

TODO #

Created with ❤️

3
likes
0
pub points
59%
popularity

Publisher

verified publishersyrokomskyi.com

A standartized and well-tested set of IDs generators: globally unique, readable, time-dependency, transitive, incremental, decremental IDs.

Repository (GitHub)
View/report issues

Topics

#generator #id #uuid #time #random

License

unknown (LICENSE)

Dependencies

meta, test, uuid

More

Packages that depend on id_gen