0.0.2 • Published 5 years ago

@afaanbilal/random-string v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@afaanbilal/random-string

Generate random strings of any length with an optional prefix (non-crypto use only)

npm.io
npm.io
npm.io

Install

npm i -S @afaanbilal/random-string

Usage

var randomString = require('@afaanbilal/random-string')

var str = randomString()
// -> UEQ1QnzGOIDXDVOw

var str = randomString({
    length: 12, // Optional, default: 16
    prefix: 'ID_', // Optional, default: ''
    charset: '1234567890' // Optional, default: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' 
})
// -> ID_328174983571

License

MIT