arindam-unique-token
v1.0.0
Published
A simple package to generate unique random token
Downloads
17
Maintainers
Readme
NPM - Package
A simple npm package to create a unique token
uniqueToken() {
return this._token() + this._timeStamp() + this._token();
},
_token() {
return Math.random().toString(36).slice(2);
},
_timeStamp() {
return (Date.now() + Math.random() + new Date().getUTCMilliseconds()).toString(36);
}
Install
npm i arindam-unique-token
Example
const token = require('arindam-unique-token');
console.log(token.uniqueToken());