@afaanbilal/random-string
v0.0.2
Published
Generate random strings of any length with an optional prefix (non-crypto use only)
Downloads
19
Readme
@afaanbilal/random-string
Generate random strings of any length with an optional prefix (non-crypto use only)
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