GitHub - cuvva/ksuid-node: Generate prefixed, k-sorted globally unique identifiers... In node!

Generate prefixed, k-sorted globally unique identifiers. You can read more about them in our blog post.

NPM Version Build Status Coverage Status

Installation

Usage

const ksuid = require('@cuvva/ksuid');

const id = ksuid.generate('user').toString();
// user_000000BgNwexbyo1VZs78wVMGdBo3

try {
	const parsed = ksuid.parse('user_000000BgNwexbyo1VZs78wVMGdBo3');
} catch (error) {
	console.log('uh oh!');
}

Testing

Install the development dependencies first:

Then run the tests 👩‍🔬:

Support

Please open an issue on this repository.

License

MIT licensed - see LICENSE file