uuid-shorter
v0.0.6
Published
### Install
Downloads
9
Readme
Easy short uuid & timeuuid
Install
yarn add uuid-shorter
or npm install uuid-shorter
Use:
import { shorter, uuid, decoder } from "uuid-shorter";
const uuid_ = uuid();
console.log(`UUID is ${uuid_}`);
const shortID = shorter(uuid_);
console.log(`shortID is ${shortID}`);
const uuid_from_shortID = decoder(shortID);
console.log(`uuid from shortID is ${uuid_from_shortID}`);
console.log(uuid_ === uuid_from_shortID ? "UUID IS SAME" : "NOT SAME UPS");
Thats it! :)
As well you can test library with test function, but for that you have to install for generate uuid or uuidv4.
yarn add uuid
import { v4, v1 } from "uuid";
import { test } from "uuid-shorter";
const number_of_test = 10000000; // number of tests
test(number_of_test, v4); // v4 is callback for create uuid