crypto-string

1.0.2 • Public • Published

Random Crypto String Generator

This is a fork from crypto-random-string to work with ExpressJS.

Info

  • I wanted a random string for my chat room that should not be ever generated again.
  • I tried using the above package but it was either not compliant with ExpressJS or I didn't know how to use it.
  • So, I decided to write my own forking the package.

Install

  • npm i crypto-string

Use

    const cryptoString = require('crypto-string')
    // Importing the package

    let id = cryptoString()
    // Generating a random string

    console.log(id)
    // hfy64j

API

  • The package exports a function that returns a random string.
  • The function takes an optional parameter length that specifies the length of the string.
    • If the parameter is not specified, the default length is 6.
  • It generates string from the alphabets and numbers with no special characters (a-z, A-Z, 0-9).
  • Hope it helps :)

Readme

Keywords

Package Sidebar

Install

npm i crypto-string

Weekly Downloads

2

Version

1.0.2

License

none

Unpacked Size

2.4 kB

Total Files

3

Last publish

Collaborators

  • tharunoptimus