pd4d10 / nanoid-dart

Dart implementation of ai/nanoid

Home Page:https://pub.dev/packages/nanoid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API 2.0

ai opened this issue · comments

Let’s update the library to be compatible with the latest Nano ID 2.0:

  • Replace ~ to - in default alphabet
  • Add non-secure fast generator
  • Async API?

v0.0.5 is published, which should implement 1 and 2.

Seems Dart SDK has no async API for random number generator currently.

Let's keep this issue to track it.

Async API is only for languages, that support it. You can ignore this part if it is not important for Dart.

I take a look at random.browser.js of nanoid, and I think we can implement this too.

It just put the following code to next tick. The crypto.getRandomValues itself is still sync.

Yeap. Async random is in async/random* files

Async API is implemented in v0.0.6. Thanks!