ts-token-generator
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Build Status

Coverage Status

ts-token-generator

This library is typescript conversion of uuid-token-generator library,

Installation

To install this library

npm install ts-token-generator

Usage

 
import { TokenGenerator, TokenBase } from 'ts-token-generaor';
 
const tokgen = new TokenGenerator(); // Default is a 128-bit token encoded in base58
tokgen.generate();
// -> '4QhmRwHwwrgFqXULXNtx4d'
 
const tokgen2 = new TokenGenerator({ bitSize: 512 baseEncodingTokenBase.BASE62 });
 
// Now generate the token
tokgen2.generate();
// -> 'x6GCX3aq9hIT8gjhvO96ObYj0W5HBVTsj64eqCuVc5X'

Package Sidebar

Install

npm i ts-token-generator

Weekly Downloads

364

Version

1.0.4

License

MIT

Unpacked Size

22.6 kB

Total Files

12

Last publish

Collaborators

  • codesnooker