You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

random-web-token

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

random-web-token

It is a fast and easy token generator

1.4.9
unpublished
Source
npmnpm
Version published
Weekly downloads
39
-58.51%
Maintainers
1
Weekly downloads
 
Created
Source

random-web-token

Generate a token easily

you can generate tokens with (a-z, a-Z, a-Z + 0-9 ...etc) or with your own characters easily

Installation

npm install random-web-token

Normal Usage

const token = require("random-web-token");

console.log(token.generate("extra", 50))

Sample: returns with 50length token

-> sHF3p8zZCTdAmJ0cyS60NK9RRPXi6NQ42zdUbigMBZYZY0504H

Promise Usage

same as token.generate() function, but returns with promise

token.promiseGenerate("extra", 50)

Parameter help for generate() and promiseGenerate() functions

functions has 2 parameters

first parameter is a string

  • "normal" ---> create a token with abcdefghijklmnopqrstuvwxyz characters
  • "medium" ---> create a token with abcdefghijklmnopqrstuvwxyz0123456789 characters
  • "extra" ---> create a token with ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 characters
  • "onlyNumbers" ---> create a token with numbers only

second parameter is a number, this tells you the length of the token

If you want to salt with your own characters

use the saltingWithMyCharacters() function

Sample:

token.saltingWithMyCharacters("abc123", 50)

generate a 50 length token with abc123 characters

Keywords

random

FAQs

Package last updated on 21 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.