marcoonroad/cuid

Slugs & API-level custom fingerprints.

marcoonroad opened this issue · 2 comments

The next release (planned to be v0.4-1) will bring the following features:

  • API-level custom fingerprints (rather than just sole environment variables).
  • Slugs (shorter CUIDs) for URL disambiguation, for instance.

The planned API-level fingerprint customization is the following:

local cuid = require 'cuid'
local fingerprint_text = "It's me, Mario!"
local id = cuid.generate (fingerprint_text)

Where the cuid.generate accepts fingerprint_text as an optional argument.
So, it could be called as well:

local id = cuid.generate ( )

And thus, no prior/previous API is broken (in the case, v0.3-1). This default case for CUID
generation will try to figure out a fingerprint out of the LUA_CUID_FINGERPRINT
environment variable, if defined. Otherwise, there's an internal machinery (a.k.a black magic)
which final users (library clients) must not rely upon.

UPDATE: Slugs and API-level fingerprints were deferred to v0.5-1 release.

Closed by commit d25f8b2.