stripe-nanoid
v0.2.3
Published
Generate random unique ids using nanoid and a prefix just like Stripe does.
Downloads
109
Readme
Stripe NanoID
A tiny, secure, unique ID generator for IDs that look similar to Stripe's.
INSTALL
To install the package:
$ npm install --save stripe-nanoid
RUN TESTS
$ npm run test
USAGE
A usage example is below:
const stripenanoid = require('stripe-nanoid');
stripenanoid('cus'); //=> "cus_rPaZmctZlfLGHdZHiljZY"
OPTIONS
A usage example with options is below:
const options = {
alphabet: 'abcDEF',
size: 4,
};
Then you can use them:
stripenanoid('cus', options)); //=> "cus_cFEa"