simplyhexagonal / short-unique-id

Short Unique ID (UUID) generation library. Available in NPM.

Home Page:https://www.npmjs.com/package/short-unique-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 3

jeanlescure opened this issue · comments

On May 14th this tiny yet widely useful library will reach the 3 year mark since its first commit.

To rise up to the occasion, as well as to match up with Deno's proposed release date for version 1, I've decided to revamp short-unique-id to better match the ethos which originally led me to Ankit Kuwadekar's source code: to have at disposal an open source, atomic, and tiny library which could generate truly unique and random ids with as little code as possible.

With the previous in mind I have the following (mostly breaking) changes in mind:

Features

  • Re-write the development workflow to use Deno for building releases (this one might be tricky as I still want to support npm) #13
  • Refactor the syntax uid.randomUUID(6) to uid()
  • Refactor the syntax uid.randomUUID(n) to uid(n)
  • Refactor the syntax uid.sequentialUUID() to uid.seq()
  • Refactor the skipShuffle option to shuffle and default it to true
  • Add a length initialization option
  • Add a uniqueness value (probability of collision, more info in #19)

Documentation

  • Add all-contributors
  • Add proper typedoc API reference documentation
  • Document why 6 was chosen as the default character length for a short uid (with actual math that I originally used for my short url project)
  • Add more details to the initialization options section
  • Add Deno usage example
  • Add README.md to short_uuid explaining relationship with this repo

Release

  • Remove -rc1 on docs and import examples

I'll leave this issue open for the following month up to May 13th in case anyone would like to take ownership over any of the listed items or contribute any other changes that might enhance short-unique-id.

All contributors avatar template:

<svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink width=100 height=100><defs><rect id=rect width=100 height=100 rx=50% /><clipPath id=clip><use xlink:href=#rect /></clipPath></defs><use xlink:href=#rect /><image xlink:href="https://avatars1.githubusercontent.com/u/3330339?s=88&v=4" width=100 height=100 clip-path=url(#clip) /></svg>

Given the way the work has been handled and the expected conflicts, when moving the work to master we better steer away from merging: https://stackoverflow.com/a/7188232/2731075