create-unique-id

1.0.2 • Public • Published

create-unique-id

A small package to create a unique id.

npm install size npm

Useage

You can generate a unique string between 2 and 22 digits long. The function accepts one parameter createUID(Number) where Number is any digit between 2 and 22. The function will round down to the closest whole, even number if you put something like 9.25.

import createUID from 'create-unique-id';

console.log(createUID(2));  // xu
console.log(createUID(4));  // f4b5
console.log(createUID(10)); // psaskfdy9d
console.log(createUID(22)); // klnt41nhfau5wz4n30pq

console.log(`uid-${createUID(6)}`); // uid-feyz4s

Issues & Ideas

If you run into an issue or have an idea to make this better please don't hesitate to file and issue.

Maintainers

Package Sidebar

Install

npm i create-unique-id

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

3.02 kB

Total Files

4

Last publish

Collaborators

  • collinmesser