Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/klipitkas/stripe-nanoid

A tiny, secure, unique ID generator for IDs that look similar to Stripe's.
https://github.com/klipitkas/stripe-nanoid

id module nanoid nodejs npm npm-package stripe stripe-id stripe-nanoid tiny uid

Last synced: 2 months ago
JSON representation

A tiny, secure, unique ID generator for IDs that look similar to Stripe's.

Awesome Lists containing this project

README

        

# Stripe NanoID

A tiny, secure, unique ID generator for IDs that look similar to Stripe's.

### INSTALL

To install the package:

```bash
$ npm install --save stripe-nanoid
```

### RUN TESTS

```bash
$ npm run test
```

### USAGE

A usage example is below:

```js
const stripenanoid = require('stripe-nanoid');
```

```js
stripenanoid('cus'); //=> "cus_rPaZmctZlfLGHdZHiljZY"
```

### OPTIONS

A usage example with options is below:

```js
const options = {
alphabet: 'abcDEF',
size: 4,
};
```

Then you can use them:

```js
stripenanoid('cus', options)); //=> "cus_cFEa"
```