nut

node-url-token

Generate random alphanumeric tokens that are URL-safe.

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-url-token NPM version

Easy to user interface to generate random URL-safe tokens. The method is fast enough to generate the token(s) synchronosly.

Installation

$ npm install --save node-url-token

Testing

There are two tests, one to test that a token of length 8 becomes unique when generating 1 000 000 tokens, this test can fail but the chance of it failing is pretty small. The 'longer' the length is the less chance there is for a collision of tokens.

Usage

Simple usage, only one method to call with option length (length of the token to be generated in characters).

var tokenGenerator = require('node-url-token');
let token = tokenGenerator.generate(32);        // Generate a token with 16 characters.
let token2 = tokenGenerator.generate();         // Generate a token with default length (16)

Options

There is only one options and that is the length of the URL-safe token to be generated.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

License

MIT © Tommy Dronkers

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100