{"id":18479124,"url":"https://github.com/kranfix/dart-nuid","last_synced_at":"2025-04-08T15:34:10.408Z","repository":{"id":53487986,"uuid":"108079702","full_name":"kranfix/dart-nuid","owner":"kranfix","description":"A Dart-lang implementation of  NATS Unique Identifiers ","archived":false,"fork":false,"pushed_at":"2021-03-29T00:33:13.000Z","size":29,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T16:06:10.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kranfix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-24T05:10:55.000Z","updated_at":"2022-08-26T15:56:17.000Z","dependencies_parsed_at":"2022-09-10T07:10:51.765Z","dependency_job_id":null,"html_url":"https://github.com/kranfix/dart-nuid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kranfix%2Fdart-nuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kranfix%2Fdart-nuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kranfix%2Fdart-nuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kranfix%2Fdart-nuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kranfix","download_url":"https://codeload.github.com/kranfix/dart-nuid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247872008,"owners_count":21010153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:13:27.334Z","updated_at":"2025-04-08T15:34:09.209Z","avatar_url":"https://github.com/kranfix.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dart-nuid\n\nA Dart-lang implementation of [NATS](https://nats.io) Unique Identifiers\ninspired by [node-nuid](https://github.com/nats-io/node-nuid) like UUID,\nbut much faster and lighter.\nThe NUID contains numbers and capital letters only, i.e. it works with base 36.\n\n## Examples:\n\nRun the `example/main.dart`:\n\n```\ndart example/main.dart\n```\n\n```dart\nimport 'package:nuid/nuid.dart';\n\nvoid main() {\n  print('String:');\n  print('  First nuid:');\n  for(var i = 0; i \u003c 4; i++){\n    print('  - ${nuid.next()}');\n  }\n\n  print('  Reseting nuid:');\n  nuid.reset();\n\n  for(var i = 0; i \u003c 4; i++){\n    print('  - ${nuid.next()}');\n  }\n\n  print('\\nBytes:');\n  print('  First nuid:');\n  for(var i = 0; i \u003c 4; i++){\n    print('  - ${nuid.nextBytes()}');\n  }\n\n  print('  Reseting nuid:');\n  nuid.reset();\n\n  for(var i = 0; i \u003c 4; i++){\n    print('  - ${nuid.nextBytes()}');\n  }\n}\n```\n\nAs code above shows, there are two methods: `next` and `nextBytes`.\nThey return the nuid in a `String` and `List\u003cint\u003e` format respectively.\nThe lastone is designed to be compatible with `Socket` in `dart:io` library.\n\n## Performance\n\nNUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly.\nNUID uses 12 bytes of crypto generated data (entropy draining), and 10 bytes of pseudo-random sequential data that increments with a pseudo-random increment.\n\nTotal length of a NUID string is 22 bytes of base 36 ascii text, so 36^22 or 17324272922341479351919144385642496 possibilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkranfix%2Fdart-nuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkranfix%2Fdart-nuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkranfix%2Fdart-nuid/lists"}