Skip to content

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

License

Notifications You must be signed in to change notification settings

AfaanBilal/random-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

@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

License

MIT

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages